WordPress.org

Ready to get started?Download WordPress

Forums

Query posts only if we're in Category 2 (1 post)

  1. freddymungo
    Member
    Posted 8 years ago #

    I'm trying to make this line of code only query posts from Category 2 only if I'm at a single post from category 2. I've figured out how to make it display on any single post, but how can I restrict it to posts from category 2?

    if (is_single()) :
    query_posts('cat=2');
    query_posts('posts_per_page=5');
    load_template( TEMPLATEPATH . '/photos.php'); else : endif;

Topic Closed

This topic has been closed to new replies.

About this Topic