我创建一个自定义的WordPress主题,我似乎无法得到single.php模板工作。以下是我写的代码。标题出现了,但内容却没有。任何想法,为什么不是?WordPresspress:single.php不显示the_content()
<?php
/**
* The Template for displaying all single posts.
*/
get_header(); ?>
<div id="content" role="main">
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
<div class="entry">
<?php the_content(); ?>
</div>
<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
</div>
</div><!-- #content -->
在这里看到输出的截图:
我不能谢谢你!!!谢谢 –
感谢您的回答 – LazyCatIT
这让我疯狂!从单个页面显示内容时,我不得不使用循环。 – Maximus