当登出时,一个博客显示 - 登录,所有博客显示

时间:2012-11-20 22:35:43

标签: html wordpress blogs

我编写了这个Wordpress网站,但我发现博客区域存在困难。博客部分只显示一个博客,但我以管理员身份登录,我可以看到页面上的所有博客。我需要它为每个人展示,无论他们是以用户身份登录还是仅以网站访问者身份登录。

我通过检查'设置>>尝试查看是否是wordpress问题。阅读'设置,它们设置得很好,显示每页10个帖子。这可能是循环的错误。我从index.php中获取博客。

http://www.ilovepennycakes.com/category/blog/

以下是未在Feed中显示的博客的直接链接。 http://www.ilovepennycakes.com/thanksgiving-thoughts/

代码如下:

<?php get_header(); ?>
 

  

<!-- Article Loop -->
<article>
  <?php if ( have_posts() ) : ?>
  <?php while ( have_posts() ) : the_post(); ?>
  <div class="news-top"></div>
  <div class="news">
    <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    <div class="post-header">
      <h1 class="meander"><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1>
      <p class="likes m500"><?php comments_popup_link( '0', '1', '%' ); ?></p>
      <div class="clear"></div>
    </div><!--end post header-->
  <!--div class="entry clear"-->
  <div class="blog-content m500">
    <?php if ( function_exists( 'add_theme_support' ) ) the_post_thumbnail(); ?>
    <?php the_content(); ?>
    <?php wp_link_pages(); ?>
  </div>
<!--/div--><!--end entry-->
    <p class="date M500">Posted <?php the_time( 'j M Y' ); ?></p>
    <p class="M500"><?php edit_post_link( __( 'Edit', 'pennycakes' ), '<span>', '</span>' ); ?></p>
<!--end post footer-->
  </div><!--end post-->
  </div>
  <div class="news-bottom"></div>
    <?php endwhile; /* rewind or continue if all posts have been fetched */ ?>
    </div><!--end navigation-->
      <div class="navigation index">
      <div class="alignleft"><?php next_posts_link( 'Older Entries' ); ?></div>
      <div class="alignright"><?php previous_posts_link( 'Newer Entries' ); ?></div>
<?php else : ?>
<?php endif; ?>
</article>
<!-- //Article Loop -->

 

任何帮助将不胜感激。

2 个答案:

答案 0 :(得分:0)

嗯...你的帖子还在“草稿”还是发表?如果它们是草稿,只有在您登录时才能看到它们是正常的,因为草稿未发布,因此不应被任何访问者看到。这是我的猜测。否则,请提供更多信息。

答案 1 :(得分:0)

好的,我有你的答案:index.php不是用来显示http://www.ilovepennycakes.com/category/blog/的文件。用于此类存档显示的文件是“category.php”。如果您的主题文件夹中没有此类文件,请添加它(可能是您编程时重复的index.php或从默认示例模板中获取)。