关于我在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主题函数中使用的任何等效函数。
关于php - WordPress主题中<em>的未知输出,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/24820236/