Skip to content

Instantly share code, notes, and snippets.

@syamilmj
Created July 19, 2012 14:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syamilmj/3144352 to your computer and use it in GitHub Desktop.
Save syamilmj/3144352 to your computer and use it in GitHub Desktop.
fix pagination on search
function aq_fix_query( $query ) {
global $paged;
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'post_type', array( 'post', 'listings' ) );
}
}
add_action( 'pre_get_posts', 'aq_fix_query' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment