在我的新主题在wordpress一个<em>
标签输出,但我不知道为什么…我不使用任何<em>
标签在我的主题的任何地方,所以我不能理解为什么这是输出和破坏我的设计。
这里是index.php的内容
<?php get_header(); ?>
<div class="row">
<div class="col-sm-12 blog-content">
<div class="container">
<div class="col-sm-8 blog-main">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="col-sm-12 blog-post">
<div class="date">
<div class="corner"></div>
<?php the_date('d M Y'); ?>
</div>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="meta">
<i class="icon-user"></i>
<span><?php the_author(); ?></span>
<i class="icon-bookmark"></i>
<span><?php the_category(', '); ?></span>
<i class="icon-bubble"></i>
<a href="<?php the_permalink() ?>"><?php comments_number('0 Kommentare', '1 Kommentare', '(% Kommentare)' );?></a>
</div>
<div class="entry">
<?php echo apply_filters('the_content', substr(get_the_content(), 0, 400) ); ?>
</div>
<div class="row">
<div class="col-sm-offset-8 col-sm-4 col-md-offset-9 col-md-3 col-lg-offset-9 col-lg-3 more">
<div class="btn">
<a href="<?php the_permalink() ?>">Mehr lesen</a>
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
</div>
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
<?php get_sidebar(); ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
在这里你可以观看我的问题现场直播。thorstenreichelt.de
在你的内容中有一个em标签(不是在你的主题中)。当你为预览截断它时,在前400个字符中,你有开始的em标签,但没有结束的em标签,所以最终的HTML和你的设计是"破碎的"。
看一下strip_tags() PHP函数,或Wordpress主题函数中使用的任何等效函数
试着添加这个:
remove_filter ('the_content', 'wpautop');
remove_filter ('comment_text', 'wpautop');
可能是你从某个地方粘贴了一些内容到那篇文章,而它遇到了一些格式
你是否已经编辑了那篇文章,并点击了主编辑区右上角的"文本",就在"视觉"旁边。这里有标签吗?