Skip to content

Instantly share code, notes, and snippets.

@JeffreyWay
Created October 15, 2011 21:51
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 JeffreyWay/1290206 to your computer and use it in GitHub Desktop.
Save JeffreyWay/1290206 to your computer and use it in GitHub Desktop.
<?php
#functions.php
function chrisypoo_add_custom_types( $query ) {
if( is_category() && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'post_type', array(
'post', 'screenshot'
));
return $query;
}
}
add_filter( 'pre_get_posts', 'chrisypoo_add_custom_types' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment