IT Nursery
This question already has an answer here: Closed 9 years ago. Possible Duplicate: How to know which one is the main query? I’m curious to know what is the...
  • April 21, 2022
  • 0 Comments
IT Nursery
I used to be able to sort query results by 2 criteria (“sort results first by status=unsold ASC then by date DESC) like this: add_action( 'pre_get_posts', 'my_get_posts' ); function...
  • April 20, 2022
  • 0 Comments
IT Nursery
I’m using pre_get_posts to adjust the number of posts displayed on my homepage. function lifelounge_query_adjust( $query ) { if ( is_home() ) { set_query_var( 'posts_per_page', 12 ); return; }...
  • April 9, 2022
  • 0 Comments
IT Nursery
I was reading Stephen Harris’s excellent answer to this question regarding the use of WP_query(), query_posts() and pre_get_posts. He says “pre_get_posts is a filter, for altering any query. It...
  • April 9, 2022
  • 0 Comments