Change Grid Arguments for a specific category

Go to Genesis > Grid Loop Settings to set the site-wide defaults. Then on the category that you want to display differently, create a template file (category-{category slug}.php) and use the genesis_grid_loop_args filter to modify the settings.

In the below example, I’m assuming you have a 3 column grid with 0 features and 9 teasers sitewide. On a category called ‘dog’ you want it changed to 2 columns with 0 features and 10 teasers. This would be the content of your category-dog.php file:

<?php
/* Template file for the "Dog" category */
/**
* Customize Grid Loop
* Display 10 posts in 2 columns
*/
function be_grid_loop_for_dog_category( $args ) {
$args = array(
'features_on_front' => 0,
'teasers_on_front' => 10,
'features_inside' => 0,
'teasers_inside' => 10,
'teaser_columns' => 2,
);
return $args;
}
add_filter( 'genesis_grid_loop_args', 'be_grid_loop_for_dog_category' );
genesis();
view raw category-dog.php hosted with ❤ by GitHub

Bill Erickson

Bill Erickson is a freelance WordPress developer and a contributing developer to the Genesis framework. For the past 14 years he has worked with attorneys, publishers, corporations, and non-profits, building custom websites tailored to their needs and goals.

Ready to upgrade your website?

I build custom WordPress websites that look great and are easy to manage.

Let's Talk