我創建一個自定義的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