badah
10/8/2014 - 8:06 PM

Wordpress: Change query properties

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' );