the_content()
не отображается, потому что он должен быть внутри Цикл - , посмотрите документы здесь »
Вам необходимо изменитькод для этого:
if ( have_posts() ) : while ( have_posts() ) : the_post();
the_content();
endwhile;
else:
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
endif;
Вы можете опустить else
, если вы всегда уверены, что у вас есть контент для отображения :) Или просто взгляните на оригинальный single.php
, где вы можете найти Цикл всегда окружает the_content()
edit:
Вот весь файл single.php, который вы можете использовать / начать с:
<?php
/**
* The Template for displaying all single posts.
*/
get_header(); ?>
<div id="content" role="main">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<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>
<?php endwhile; endif; ?>
</div><!-- #content -->