我目前正在学习如何制作 wordpress 主题,但不知何故标题标签被破坏了。出于某种原因,它在代码中添加了引号,并且代码正在页面本身上显示。我知道这会影响 WP 3.4 及更高版本,但我没有使用任何插件等。请问解决此问题的正确方法是什么?谢谢。我的 Wordpress 版本是 3.6。
这是我显示帖子的循环。
<div role="main">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<article <?php post_class(); ?>>
<header class="post-header">
<a class="post-header" href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></header>
<time class="post-date"><p> <?php the_time('l, j M Y')?></p></time>
<p class="post-content"><?php echo get_the_content(); ?></p>
<!-- put post class tags in -->
<div class="tags-container">
<?php $tags = get_the_tags();
if( $tags ) : ?>
<?php foreach( $tags as $tag ) { ?>
<span class="tags <?php echo $tag->slug; ?>"><i class="icon icon-tag"></i><a href="<?php echo get_tag_link($tag->term_id); ?>"><?php echo $tag->name; ?></a></span>
<?php } ?>
<?php endif; ?>
</div>
</article>
</div>
<?php endwhile; ?>
<?php endif; ?>