Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. function is_post_type($type){
  2. global $wp_query;
  3. if($type == get_post_type($wp_query->post->ID)) return true;
  4. return false;
  5. }
  6. function query_oliverio( $query ) {
  7. if ( is_admin() || ! $query->is_main_query() )
  8. return;
  9. if ( $query->is_main_query() && $query->is_category( 'gastronomia' ) ) {
  10. $query->set('posts_per_page', 5);
  11. }
  12. }
  13. add_action( 'pre_get_posts', 'oliverio', 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement