WordPress博客不会显示帖子标题,元数据或评论

时间:2017-06-27 17:34:45

标签: wordpress

我确定这是一个简单的解决方案,但我并不是一个程序员。

我为3或4年前的一位客户编写了一个WordPress网站。他们要求在他们的网站上添加一个博客。

发生了一些奇怪的事情,我并不完全确定原因。

如果你去:http://firstcalliowa.com/blog/

您可以看到它没有显示帖子标题或元数据。只是帖子内容。

另请转到:http://firstcalliowa.com/author/austinhudspeth/

所以,这很有趣。在这里,您可以看到帖子标题并编辑此链接。帖子标题没有链接,但可以修复。有趣的是,我还没有制作作者文件。所以,我不确定为什么它在这里看起来更正确,但不会在第一个链接上拉出帖子标题。

这是我的循环代码:

`   <div id="content">
        <div id="content_container">

       <!-- Start the Loop. -->
 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

 <!-- Test if the current post is in category 3. -->
 <!-- If it is, the div box is given the CSS class "post-cat-three". -->
 <!-- Otherwise, the div box is given the CSS class "post". -->

 <?php if ( in_category('3') ) { ?>
           <div class="post-cat-three">
 <?php } else { ?>
           <div class="post">
 <?php } ?>


 <!-- Display the Title as a link to the Post's permalink. -->

 <h2><?php the_title(); ?></h2>


 <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->

 <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>


 <!-- Display the Post's content in a div box. -->

 <div class="entry">
   <?php the_content(); ?>
 </div>


 <!-- Display a comma separated list of the Post's Categories. -->

 <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
 </div> <!-- closes the first div box -->


 <!-- Stop The Loop (but note the "else:" - see next line). -->

 <?php endwhile; else: ?>


 <!-- The very first "if" tested to see if there were any Posts to -->
 <!-- display.  This "else" part tells what do if there weren't any. -->
 <p>Sorry, no posts matched your criteria.</p>


 <!-- REALLY stop The Loop. -->
 <?php endif; ?>
</div>`

1 个答案:

答案 0 :(得分:0)

在您提供的第一个链接上,它看起来与您提供的HTML不同。您是否可以进行测试编辑以确保/ blog页面实际上正在使用您创建的循环?我看到一个空的.post-header div正在输出,但我没有在你的循环中看到它。

相关问题