Skip to content

Instantly share code, notes, and snippets.

@pfefferle
Last active December 19, 2015 15:09
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 pfefferle/5974102 to your computer and use it in GitHub Desktop.
Save pfefferle/5974102 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Exclude Cat 24
Plugin URI: https://gist.github.com/pfefferle/5974102
Description: Exclude Cat 24
Author: pfefferle
Author URI: http://notizblog.org/
Version: 1.0.0-dev
*/
function ekaabo_exclude_cat( $query ) {
if ( $query->is_main_query() ) {
$query->set( 'cat', '-23' );
}
}
add_action( 'pre_get_posts', 'ekaabo_exclude_cat' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment