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
- How to make WP_Query faster when getting a post from one year ago?
- Display the latest post from some selected authors
- WP Query between posts custom fields [duplicate]
- Query to get data of a post, if in category?
- Order posts by custom field
- Ordering posts alphabetically by meta keys and title
- How to show the posts list into a static page? Problems to use the loop into a static page
- Grab next post title in archive page
- How do I control the fallback query after the original query returned cero posts?
- Removing a post from the results of a WP Query
- Remove duplicated posts in the loop if post has more than one category
- Query posts from a specific category and selected tag
- Continuous listing from a custom field
- Pagination for custom query won’t let me back on page 1
- Order posts by separate menu order for different sub-categories
- Retrieve latest post by multiple categories with ID
- Adding a category at even positions on main loop with modified pagination
- Query Posts From Multiple Post Types
- Sort post by category using HTML Select tag
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to store post rating system data post independent?
- Update Post with Modified Data
- Multiple loops on a Search result page?
- Get first comment link on the post itself
- Can’t get pagination to work
- How to Include a common category in a custom Category Search
- Why I getting only 1 post?
- The next_posts_link() works only with original $wp_query
- Special Query: Title, Terms, Content – %LIKE%
- What is wrong with this wp_query?
- wp_query select if have comments
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Creating pages and getting their values from the database table
- Make division in post_query?
- WP_Query based on a custom field result
- How to limit post query to only return a total count of items with certain post statuses?
- How to get single post by one author?
- wp_query posts sorting doesn’t work
- Order by ‘s’ using WP_Query()
- Display one post randomly from category on home page
- Exclude sub sub categories from displaying in the archive page
- Limit amount of pages shown in pagination within wp_query
- Cannot exclude particular post from loop of custom post type
- Exclude a ‘portfolio’ custom category?
- How do I show the post title if an advanced custom field hasn’t been used?
- custom sort posts in archive/taxanomy page
- First post in loop displays twice
- how to print loops for odd in 1st column and even in 2nd column in wordpress [closed]
- List posts related to category on a div [closed]
- WP_query sort by custom meta_key “price”
- Trying to create shortcode listing custom posts, but formating not being included
- How to set value in Query Loop?
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]