WordPress.org

Support

Support » Plugins and Hacks » Query posts only if we’re in Category 2

Query posts only if we’re in Category 2

  • 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;

  • The topic ‘Query posts only if we’re in Category 2’ is closed to new replies.
Skip to toolbar