【发布时间】:2012-01-04 23:49:36
【问题描述】:
我正在创建一个自定义 Wordpress 主题,但我似乎无法让 single.php 模板工作。下面是我写的代码。标题出现了,但内容没有出现。任何想法为什么不是?
<?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 -->
查看这里的输出截图:
【问题讨论】:
标签: php wordpress wordpress-theming