I want only posts from the category "blog" to show up on the blog page and in the blog sidebar. I have different sections of my site and I want posts from specific categories to show up in specific sections. All of the sections work properly except the main blog, which shows all the different categories.
I added the query_posts code to my index.php file which is the template for the Blog page. The code works fine on my "journals" pages, only showing posts from that category. It's only not working on the blog homepage. http://www.peainthepodcast.com/blog
Journal Section (works correctly):
http://www.peainthep...gnancy-journals
Here is my index.php code:
<?php get_header(); ?>
<div id="blog">
<?php include (TEMPLATEPATH . '/sidebar.php'); ?>
<?php query_posts('cat=115'); if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id="blog_post">
<div class="post" id="post-<?php the_ID(); ?>">
<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<p>posted by <?php the_author_posts_link(); ?></a> on <div class="post_date"><?php the_date('','',''); ?></div></p>
<?php the_content(__('(more...)')); ?>
<?php edit_post_link(__('Edit This')); ?>
<div class="post_footer">
Categories: <?php the_category(',') ?>
Tags: <?php the_tags(__(' '), ', ', ' — '); ?>
<?php comments_popup_link(__('Comments (Leave a Comment)'), __('Comments (1)'), __('Comments (%)')); ?>
</div>
</div>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
<?php posts_nav_link(' — ', __('« Newer Posts'), __('Older Posts »')); ?>
<div class="content_bottom"></div>
<?php get_footer(); ?>
</div>

New Topic/Question
Reply
MultiQuote







|