Last active
December 14, 2015 03:29
-
-
Save braddalton/5021515 to your computer and use it in GitHub Desktop.
Custom Genesis blog page loop with exclude posts from one 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
<?php /* | |
Template Name: Exclude Categories | |
*/ | |
/** Custom Genesis loop */ | |
remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
add_action( 'genesis_loop', 'child_do_custom_loop' ); | |
function child_do_custom_loop() { | |
global $paged; | |
global $query_args; // grab the current wp_query() args | |
$args = array( | |
'category__not_in' => -30, // exclude posts from category i.d 30 | |
'paged' => $paged, | |
); | |
genesis_custom_loop( wp_parse_args($query_args, $args) ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment