A in your example, you have access to all the WP_Query Object query_vars (see [here])1, you could use the post__not_in
query_var in your query. It takes an array of ids as a parameter. So first you query for your posts tagged ‘highlighted’.
While displaying them, you would add all their ids to an array like so
<?php
$do_not_duplicate = array(); // set befor loop variable as an array
while ( have_posts() ) : the_post();
$do_not_duplicate[] = $post->ID; // remember ID's of 'highlighted' posts
//display posts
endwhile;
?>
then you kick off another query like so.
<?php
// another loop without duplicates
query_posts( array(
'post__not_in' => $do_not_duplicate
)
);
while ( have_posts() ) : the_post();
// display your posts without the highlighted
endwhile;
?>
Related Posts:
- Exclude some posts from displaying in wp_query based on some condition
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- Random sort within an already sorted query
- WP_Query offset argument does not work
- Skipping first 3 posts in wp query
- How to know if get_posts() failed?
- WordPress Number of Posts Not Changing With posts_per_page
- How to add posts to wp_query result?
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- Search query – exact post title match
- posts_per_page doesnt work
- WP_Query: offset ignored when posts_per_page is -1?
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- how to get posts ids inside pre_get_posts filter?
- Get Posts that are in the current month or later
- posts_per_page option limits the number of Gallery items
- Why Query is returning empty array?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- meta_value timestamp older than now
- Loop doesn’t exclude the specified category in home page
- Do not show children of a category
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- How to give classname to post if post has no content?
- Related Posts function not working
- How to retrieve certain number of images from a wordpress post?
- How to convert query sql to shortcode in wordpress?
- Use posts_where to exclude posts ids from wp_query
- How Can I Always Display A Particular Post First Using WP_Query?
- WordPress Query – Display 5 posts (same post type), each from a given tag
- Manipulated offset and pagination, can’t display last post anymore
- filter posts based on menu_order
- Show 5 posts and than 3 posts offset with pagination
- wp query custom orderby not custom field
- Sort / Filter Queries
- Advanced Post Display/Pagination/Ordering
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Displaying Results From Custom Taxonomy Query
- WP_Query retrieve custom posts but not the post showing
- Wp_query WooCommerce products
- Accessing the post content with WP_Query
- Exclude ALL posts from sub categories
- Get only modified posts
- How to output comments number of a post per day?
- How can I get all posts data from within a paginated search result?
- If specific user role then sticky post
- Display posts with comments closed, with pagination?
- Only display posts after current date
- I want to query posts in monthly basis
- Custom WP_QUERY $args
- Query: offset post list, unless it’s a specific category
- Limiting the number of posts in WP_Query leads to unexpected result
- WP_Query Authors OR Categories
- How to do set post permalinks using 6 digit random unique function?
- get query() without post content?
- How can I setup a relationship using categories in WordPress?
- how to change the number of posts returned in a specific loop without making it global?
- How i can limit period of post publication?
- Exclude current custom post on single post
- Nested WP_Query breaking loop
- 2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?
- post__in not working with pre_get_posts, but post__not_in does work
- Query posts and filter at query time by value of custom meta
- Getting blog pagination to work on page set as front page
- search blog posts by author first name and or last name
- Very complex post query
- Delete post revisions only for a single post
- unique post in “$args” of wp_query display more than one post
- Display post by click on the link
- How to display post list in a table layout (multiple queries in single loop)
- Not all posts showing in query
- WordPress query portfolio posts
- Get latest author posts inside the loop
- Limiting post list by taxonomy
- Display 3 posts with different HTML markup using a loop
- How to show multiple posts thumbnail, title and date in widget
- Group first, 2nd, 3rd, etc posts by category terms
- Query to fetch custom taxonomy along with post title
- How to fetch courses in all languages in WordPress?
- How to display particular set of wordpress post on a webpage?
- Is it possible to query a category with specified posts?
- Query posts from newest category
- WordPress loop uses unmodified posts array, why?
- Show posts between two Custom Fields date
- Query to get data of a post, if in category?
- Order posts by custom field
- Ordering posts alphabetically by meta keys and title
- Grab next post title in archive page
- Remove duplicated posts in the loop if post has more than one category
- Continuous listing from a custom field
- How to store post rating system data post independent?
- Why I getting only 1 post?
- First post in loop displays twice