• I would like to have a page only list posts from one category instead of all the posts when I am in Gallery.

    Right now I have a page titled “Press Releases” and that page I have enabled the Showcase Template.

    I only want the posts from category “press-releases” to show up at the bottom of that page. Right now all the posts show up.

Viewing 2 replies - 1 through 2 (of 2 total)
  • are you using or intending to use the ‘showcase’ template for other pages in your site as well?

    if you are only using the ‘showcase’ template for the ‘press releases’ page, you could edit showcase.php –

    now is the time to create the child theme; http://codex.wordpress.org/Child_Themes

    in showcase.php in the child theme, locate:

    $recent_args = array(
    						'order' => 'DESC',
    						'post__not_in' => get_option( 'sticky_posts' ),
    						'tax_query' => array(
    							array(
    								'taxonomy' => 'post_format',
    								'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
    								'field' => 'slug',
    								'operator' => 'NOT IN',
    							),
    						),
    						'no_found_rows' => true,
    					);

    change that to include a category parameter:

    $recent_args = array(
    						'order' => 'DESC',
    						'post__not_in' => get_option( 'sticky_posts' ),
    						'category_name' => 'press-releases',
    						'tax_query' => array(
    							array(
    								'taxonomy' => 'post_format',
    								'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
    								'field' => 'slug',
    								'operator' => 'NOT IN',
    							),
    						),
    						'no_found_rows' => true,
    					);

    http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters

    if you are using the ‘showcase’ template for other pages, you could create a copy, save it under a new file name into the child theme, change the ‘Template Name:’ at the top, and make the other edits.

    Thread Starter MikeHill

    (@mikehill)

    You the man… that worked perfectly

    Really appreciate it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Twenty-Eleven: Showcase Template only show one category on page’ is closed to new replies.