Support » Fixing WordPress » Category Template: How Do I Show the Post of Just One Category?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Doesn’t a link to a specific category work? If you’re looking for something else, you probably need a new category archive template with a conditional prefacing the loop code.

    I am still pretty new to WordPress and PHP, but I hope this helps.

    Have you tried adding 'cat=1' (change 1 to your category number) inside of query_posts?

    If you want multiple category’s you can try 'category__and' => array(1,3), you would add this inside of query_posts(array('category__and' => array(1,3),));

    Let me know if this helps.

    Didn’t work :/

    I should clarify that I want to display ALL posts for one particular category (the title is a bit misleading).

    I also tried:

    <?php $args = array(
            'posts_per_page'   => 5,
            'offset'           => 0,
            'category'         => get_cat_ID( 'success' ),
            'orderby'          => 'post_date',
            'order'            => 'DESC',
            'include'          => '',
            'exclude'          => '',
            'meta_key'         => '',
            'meta_value'       => '',
            'post_type'        => 'post',
            'post_mime_type'   => '',
            'post_parent'      => '',
            'post_status'      => 'publish',
            'suppress_filters' => true );
            if(have_posts()) : while(have_posts()): the_post();

    [Moderator Note: Please post code & markup between backticks (not single quotes) or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    This still shows all posts…no good…Any suggestions?

    I’m not sure I understand how that is different from clicking a category (which shows all posts in that category)? Or are you trying to display posts outside a category page?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Category Template: How Do I Show the Post of Just One Category?’ is closed to new replies.