Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created December 18, 2014 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/284f5b4135c67c66b3e0 to your computer and use it in GitHub Desktop.
Save billerickson/284f5b4135c67c66b3e0 to your computer and use it in GitHub Desktop.
<?php
//* Remove the post meta function
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
add_action( 'pre_get_posts', 'be_exclude_category_from_blog' );
/**
* Exclude Category from Blog
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
* @param object $query data
*
*/
function be_exclude_category_from_blog( $query ) {
if( $query-&gt;is_main_query() &amp;&amp; $query-&gt;is_archive() ) {
$query = new WP_Query( 'cat=-12,-34,-47' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment