Wordpress: Change query properties
/*
Change query properties
*/
function badah_change_query( $query ) {
if ( !is_admin() && $query->is_main_query() ) {
if ( $query->is_front_page() ) {
$query->set( 'showposts', 1 ); // whatever
}
}
}
add_action( 'pre_get_posts', 'badah_change_query' );