WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Show Just One Category On Page (2 posts)

  1. dbooth
    Member
    Posted 10 months ago #

    We need to just display one particular category of posts on a page. The current template that we have on this page uses $args to determine the custom post type, but we want this page to just display a specific category. We would replace the whole template, if it wasn't for the fact that there is a whole array beneath the selection of post type that determines how everything is sorted.

    I tried using
    $args['category'] = 'catnumber';
    in conjunction with or replacing
    $args['post_type'] = 'post';
    but with no luck.

    Any way to quickly insert the code we need?

  2. dbooth
    Member
    Posted 10 months ago #

    Nevermind, figured it out! For those keeping score at home, it wasn't 'category,' but 'cat', as such:

    $args['cat'] = '119';

    I had to remove the post_type argument outright, and it works fine now.

Reply

You must log in to post.

About this Topic