Support » Themes and Templates » Show Just One Category On Page

  • Resolved dbooth


    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?

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Show Just One Category On Page’ is closed to new replies.