Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
**
* Customize Blog Query
*
*/
function be_blog_query( $query ) {
if( $query->is_main_query() && !is_admin() && $query->is_home() ) {
$query->set( 'category_name', array( 'cat-1', 'cat-2', 'cat-3' ) );
}
}
add_action( 'pre_get_posts', 'be_blog_query' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment