Created
November 5, 2012 13:14
-
-
Save billerickson/4017135 to your computer and use it in GitHub Desktop.
Limit Genesis Grid to Specific Category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Don't use grid on category 'featured' | |
* | |
* @param bool $display | |
* @param object $query | |
* @return bool $display | |
*/ | |
function be_limit_grid_loop( $display, $query ) { | |
if( $query->is_main_query() && $query->is_category() && genesis_get_option( 'grid_on_category', 'genesis-grid' ) ) { | |
if( $query->is_category( 'featured' ) ) | |
$display = false; | |
else | |
$display = true; | |
} | |
return $display; | |
} | |
add_filter( 'genesis_grid_loop_section', 'be_limit_grid_loop', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment