Guest User

Untitled

a guest
May 25th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. add_action('pre_get_posts', 'td_modify_main_query_for_category_page');
  2. function td_modify_main_query_for_category_page($query) {
  3.  
  4. //checking for category page and main query
  5. if(!is_admin() and is_category() and $query->is_main_query()) {
  6. $query->set( 'offset', 5);
  7. }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment