Forums

[resolved] Only one category showing on every page (2 posts)

  1. blueyonder
    Member
    Posted 3 years ago #

    I have a horizontal "sidebar" placed under my header and nav bar. In this sidebar I have a box that I want to display posts from the category "Topic of the Week" which is category 3.

    I inserted the code:

    <ul>
        <?php query_posts('cat=3'); ?>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a><br />
        <?php the_excerpt(); ?></li>
        <?php endwhile; ?><?php endif; ?>
    </ul>

    It works great and shows the post from that category and the excerpt. Unfortunately, it also forces all of the pages on the site to just show that category. Nothing else will show since I guess it is overriding the normal call for posts and pages.

    Any suggestions to fix this?

    Thanks everyone!!!

  2. blueyonder
    Member
    Posted 3 years ago #

    Nevermind. I added a new query like in Example 1 vers.3

    http://codex.wordpress.org/The_Loop#Multiple_Loops_Example_1

Topic Closed

This topic has been closed to new replies.

About this Topic