Skip to content

Instantly share code, notes, and snippets.

@MZAWeb
Forked from anonymous/gist:5438249
Created April 22, 2013 20:36
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 MZAWeb/5438318 to your computer and use it in GitHub Desktop.
Save MZAWeb/5438318 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'pre_get_posts', 'cambia_queries', 10, 1 );
function cambia_queries( $query ) {
if ( $query->is_category( 31 ) && $query->is_main_query() ) {
$query->set( 'cat', array( 18, 31 ) );
$query->set( 'posts_per_page', - 1 );
}
return $query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment