我创建了自己的主题。在我的头版(index.php
)上,我展示了一些帖子,最后是“阅读更多”链接。所以当我点击阅读更多时,我被重定向到该帖子的页面(localhost/wordpress/2014/post-title/
),但在那里,我看不到帖子的标题,但是看到了所有内容。WordPress的帖子从链接重定向时不显示标题
中的index.php代码片断
<div id="blog" class="container">
<?php query_posts('showposts=3'); ?>
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="post col-md-4">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<div class="entry">
<?php the_post_thumbnail(); ?>
<?php the_excerpt(__('(more…)')); ?>
<p class="postmetadata">
<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?><br />
<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
</p>
</div>
</div>
<?php endwhile; ?>
<div class="navigation">
<?php posts_nav_link(); ?>
</div>
<?php endif; ?>
</div>
那么,如何让文章标题呢?
你的主题中是否有single.php?如果你这样做,请发布它的代码。 – Kaloyan
哦!我没有包含该文件。 –