Never mind, I got it.
For anyone who may run into a similar issue. See below.
Main Loop:
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
unset($do_not_duplicate);
$the_query->the_post();
}
}
Secondary Loop:
if ( $projects_query->have_posts() ) {
while ( $projects_query->have_posts() ) {
$do_not_duplicate[] = get_the_ID();
if( in_array( get_the_ID(), $do_not_duplicate) )
continue;
}
}
Related Posts:
- How to get an array of post data from wp_query result?
- How to only display posts whose meta_value field is not empty?
- How to print the excuted sql right after its execution
- Find out total number of pages in global query on archive page?
- Resetting post data to previous loop in nested loops
- Is it possible to completely stop WP_Query retrieving posts?
- How to add taxonomy filter on the query fly?
- Pagination returns 404 after page 20
- Make a WP Query search match exactly the search term
- Make loop display posts by alphabetical order
- Displaying several specific pages using WP_Query()
- post_type is ignored by WP_Query when ‘tag’ argument is included
- How to query posts of standard post format. For real
- Orderby menu_order doesn’t work
- WP_Query by Category Name
- WP-CLI How to generate a list of posts with corresponding meta values
- Query to return maximum of one post per author
- Warning: urlencode() expects parameter 1 to be string, array given
- WP_Query OR clause for tax_query and keywords
- How to get the posts published in last two days using WP_Query?
- All sticky posts are returned in custom query
- Get attached media only
- query posts in functions.php and update a field
- get_posts() seemingly ignoring post_type
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Can not switch the queried post in pre_get_posts hook
- Why use JSON API to display recent posts?
- Why query_vars get altered in WP_Query Object?
- Pagination problem after WP_Query with tag filtering
- pre_get_posts filter meta_query without conflicting existing meta_query
- Get list of terms that have posts in another term
- Get data of all posts of a query before pagination
- How to avoid wp_query returning the same post I’m on in results?
- Custom query for sidebar isn’t returning results
- How to vary post loop results layout and resume?
- Adding an array from a query string to a WP meta_query
- WordPress add_rewrite_rule() cannot visit lower url levels
- WordPress Loop and $post
- How can I create ‘future’ and ‘past’ parameter for restAPI by filtering the CPT custom date field by greater than / less than current datetime?
- WP_Query tax query part of slug
- How to implement a new row_count method in WordPress?
- Some doubts about how the main query and the custom query works in this custom theme?
- How to do a wp_query with two acf-fields, sorting on one of them
- Using Advanced Custom Field for file upload, how do I load the file url
- Retrieve posts using thumbnail id as meta key
- Shortcode for latest -not expired- posts
- Only display post if published in last 24 hours?
- WP_Query loop else statement not executing
- Modify Search Query if original Query gave no results
- How to cache wp_query with pagination using transients?
- Problem with WP_query
- Why is WP_Query not displaying expected data?
- Filter post query to only show direct children of category
- has_excerpt() not working inside wp_query
- Get every post with value in meta key
- Using get_posts to get posts based on a checkbox value with Advanced Custom Fields
- Display all posts in a custom post type, grouped by a custom taxonomy. How to sort the posts alphabetically and the terms by ID?
- How do I add a relation parameter to my filter query?
- Hacking ‘posts_per_page’ in WP_Query
- How to get posts by category and by choosing a taxonomy term?
- Query outputting YouTube url rather than embedded video
- Paginate pages with dynamic query
- WP_Query loop doen’t work with my custom taxonomy
- get_var is neither a string, integer, or array …?
- Deleting terms from the WordPress wp terms table
- Can I get one wp_query to double order like this?
- In a WP_Query can I force the results’ is_singular() to be set to false?
- Sort custom post by custom field if none order by latest release
- Order (by ASC) posts with meta_key so posts without values are last
- Query pages created by deleted users
- how to include orderby value that is empty?
- Get posts that match defined arrays of tags
- WordPress live search and filter
- Why can my filter query SOME metadata but not other metadata?
- Custom query showing all acf field values instead of the one searched
- Pagination Shows Up But Won’t Work on Custom Gallery Page
- How can I use WP_Query to sort ‘event’ custom post type by date?
- posts_per_page in a tax_query
- Modify a query with no results in pre_get_posts
- WP_Query: custom orderby (not ASC nor DESC)
- Show posts from categories instead of tags
- Sorting Posts by Taxonomy thats not within the query’s $args
- Orderby query does not work for custom fields even with meta query
- WP_Query: Meta_Query with serialized value (or a workaround)
- Query All Attachments and Order by Parent Publish Date
- WP_Query using meta_query with LIKE doesn’t return what it should
- Query post Pagination Problem
- How to organize a WP_Query’s list of posts by category and display category title?
- How to Query Updated Post in WordPress
- wordpress nested loop
- Pull Instagram images into an existing loop?
- Query_vars not working for me
- Query posts only shows 1
- Query custom post types by meta field in a term from custom taxonomy
- First post outside of loop, homepage only?
- Filtering product search results using tags
- WordPress extremely slow when using get_posts with multiple meta_query relations
- Refresh wp_query with no changes
- SQL query into to WP query
- Search results stuck on page 1