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...
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...
I want to list images for only user uploaded image. Here is the scenario: Using the image uploader on front end using iframe. I have added upload_files cap to...
How can I change the order of posts in the admin dashboard, so they display alphabetically according to title, rather than latest first? 2 s 2 If you don’t...
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for WordPress Development Stack Exchange. Closed 8...
I found this question: Theres a way to use $query->set(‘tax_query’ in pre_get_posts filter? which seems to indicate that yes, you can alter the taxonomy query on taxonomy archives via...
Theres a way to use $query->set('tax_query', ...) in pre_get_posts filter? for example next code is not altering the query. Note that I’m building $taxonomies from and custom search. function...
I have done quite extensive research on how to use pre_get_posts on true pages and the static front pages, and it seems that there is no fool proof method....
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; }...
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...