Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
/**
* Modify Blog Query
*
*/
function be_blog_query( $query ) {
if( $query->is_main_query() && $query->is_home() && !is_admin() ) {
// customize blog query here
$query->set( 'posts_per_page', 12 );
}
}
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
You can’t perform that action at this time.