Completely canceling main query is pretty much high level madness, that involves subclassing wp
class.
I would:
- Hook into
pre_get_posts
withis_main_query()
check - Run featured query (still inside hook) and stash results somewhere
- Use those results to set excluded posts on main query
Related Posts:
- WordPress Query is taking more then 20 second and stuck on creating index
- Improve wp query perfomance on large db
- WordPress Query optimaization for slow query
- Page template query with WP_Query
- Return only Count from a wp_query request?
- Use REGEXP in WP_Query meta_query key
- Set Alias for meta_query arguments in get_posts()
- Order by DESC, ASC in custom WP_Query
- How to stop wordpress to make the default query?
- $wp_query initiation?
- Executing Queries in tag.php
- Slow SQL_CALC_FOUND_ROWS Query
- SQL query equivalent to WP User Query
- What’s wrong with this WP query?
- How to count post meta key values for all posts in database
- Group posts by meta_key
- How to search for posts IN OR title OR content OR author?
- Would this post meta be better added to the post table rather than post_meta table
- Order By Multiple Meta Fields
- meta_query on a date range using an array of values
- Pass the same object to multiple widgets in a template with one query
- Splitting the main query in multiple loops with query_posts and/or pre_get_posts?
- SQL User Query by Multiple Roles using PHP
- Get the Plugin Which Triggered a MySql Query in WordPress?
- What’s faster? One big query, or several smaller ones?
- Mysql query LIKE not working
- How to get posts on a specific date – WP Query
- Using WP_Query and WP_Meta_Query Outside of WordPress
- How to find exact match for search term in WP_Query? What is the additional string added in LIKE query in WP_Query?
- Order by custom table and multiplication
- Have functions work outside the loop with 404 override
- Single meta_query query using OR instead of AND in request’s WHERE statement
- why update and delete query not worked in custom table?
- Show all post for a given category
- How to use MySQL’s MATCH AGAINST in WP_Query?
- Database Queries Optimization with new WP_Query
- Slow WP_Query for custom post type
- Performance when getting post meta for post retrieved by meta value
- Hide Administrators From User List except current user (administrator)
- Add “Category” to Mysql Query
- How to optimize multiple WP_Query() calls on one page?
- Help with WP_Query – Too many mySQL queries
- Using hook to use DISTINCT in a wp_query
- pagination with ‘no_found_rows’ => true,
- How to show optimized list of posts with all their attachment images
- Query posts without meta preload
- How to implement a new row_count method in WordPress?
- Wp query show post by author name or post title or post content
- Query most popular terms by taxonomy over 2 week period
- Which is faster wpdb & get_row or wp_query & ge_post_meta?
- Is there a better way to pull in custom content without querying posts?
- how update data through ajax and jquery
- Meta Query doesn’t works as espected
- WordPress Custom Search Form Displaying Unexpected Results
- Is there a way to make this kind of loop shorter and nicer?
- how to get Nearby zipcode
- Utilising an existing page while using the “s” query parameter
- How I can change the condition or compare operator for WP_Query in pre_get_posts
- Get posts in taxonomy randomly
- mysql query order by
- How to generate feed for custom template
- Function to retrieve IDs of posts, cache results, and improve wp_query
- Query multiple meta key values for template
- Unable to paginate a custom page query
- get_var is neither a string, integer, or array …?
- How to stack name list in non-alphabetical order?
- problem with the loop
- Optimising WP_Query with ACF Fields
- get_children() Archive Template
- In a WP_Query can I force the results’ is_singular() to be set to false?
- SQL query injection with fifu image
- WP Query – grouping posts by same meta key, adding together values from another key
- Woocommerce Get Orders By Meta Value
- SQL to join u3g_users & u3g_meta_value with repeating data
- INNER JOIN custom tables – SQL Query
- use mysql variable in a $wpdb->query to reindex a column?
- One of two similar WP Query is very slow
- How to display a post(by id) along with css in a page?
- Fix wp_term_relationships slow query in get_posts
- Sorting query_posts() with a complex orderby filter
- Case insensitive ORDERBY in wpquery
- Query postmeta based on meta_value, return array of post_id
- Order Posts By Custom Field That is an array of objects
- ACF: using two loops, the_field returns field content from another loop
- Multiple wpostmeta.meta_key
- Slow query when selecting with large meta query or post__in
- Search Filter With Custom Taxonomy and Custom Fields : How do I handle it via plugin?
- WP_Query always returning the last custom post
- Optimize WP_Query
- ordering and optimizing functions
- Get a list of the last posts grouped by author and filtered by category
- meta_query dates from an array
- Different sql queries count indicator on the main page [closed]
- Parsing External Table Arguments
- Adding css tweak based on page template
- WordPress query very slow on +/- 300k DB entries and 7 INNER JOIN
- SQL query into to WP query
- Bulk delete comments, foreach loop
- on attachment.php, how to display previous and next attachment links that follow the same order as a custom WP Query
- WordPress – Optimize the Meta Query for 3 meta keys at a time