I wrote a class specifically for passing data between widgets classes using static variables and it will work for your use case as well. Grab the class here.
The way you would use this is as follows for each custom loop:
$exclude_ids = IntermediaryData::get(); //Retrieve previous exclude IDs
$args['post__not_in'] = $exclude_ids;
//new WP_Query($args); Custom loop query
//Loop Start
$exlude_ids[] = $post->ID,
//Loop End
IntermediaryData::set($exclude_ids); //Pass IDs to next loop
Related Posts:
- WP_Query vs get_posts
- get_posts output always same post
- Ordering Posts by parent category, name ascending
- When should you use WP_Query vs query_posts() vs get_posts()?
- When to use WP_query(), query_posts() and pre_get_posts
- Nested meta_query with multiple relation keys
- Some doubts about how the main query and the custom query works in this custom theme?
- Order posts by ID in the given order
- get_template_part in for loop
- How-to exclude terms from the main query the most performant way?
- Get the number of posts from the current page results
- How can I save an array from a random post sequence for later use?
- WordPress Custom Query to show posts from last x years
- Query Custom Meta Value with Increment
- Get posts by meta data OR title
- Meta Query with date and time on the same Day before given time
- Retrieving 3 latest post from each of 5 different custom post types
- Pagination Not working on Home Page with 2 Query
- Show default content if custom WP_Query has no posts
- get_posts() seemingly ignoring post_type
- How to query ‘posts_per_page’ to display a different blog posts index template?
- How to find out what “Blog pages show at most” is set to [duplicate]
- 2 loops on page – one with orderby rand second orderby date
- How do you Query posts with nothing in common?
- Get posts for last working week in WP_Query
- Query posts by specific word on title
- Sub-loop / nested loops Best Practices
- Five posts from a category in footer
- Multiple loops without repeating content
- WP_Query condition affects posts_per_page count
- add active class based on permalink and url
- Some doubts about how the main query and the custom query works in this custom theme?
- Conflict with get_posts and the_content
- Reset WordPress Post Query to default
- How do I rewrite this loop as a new WP_Query style-loop?
- Include current post into loop
- Best choice for multiple loop in page?
- Get all posts which was posted on X Days WordPress
- How to provide meta_key array to wp_query?
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- How to create custom query by keyword in post title?
- How to make posts unqueryable/unpublish posts where ACF relationship field is an unpublished post? [closed]
- Conditional operator OR not working with custom fields
- complex get_posts() query to select child pages
- Get posts that do not have the same tags as current
- Should I reset $wp_query?
- Posts query according to meta box date
- How to access $wp_query object from array of posts given by get_posts?
- Function using get_posts() with tax_query not working when called from functions.php
- 2 queries with counters
- Paginate pages with dynamic query
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Determine if ID is page or post and query the ID
- How to query for a page, get data, then query for child pages of that page
- Custom template for password protected page
- Prioritising and Ordering Posts By Category Name Using A Custom Loop
- Facing problem with tax_query results
- Populate select list with meta values from all posts of a Custom Post Type
- Duplice post with standard WP loop – fixed by using query_posts() instead
- How do I stop the same post showing multiple times in a archive?
- Related posts queries
- Custom query for custom post type not getting correct post ID
- Problem with my loops
- WordPress For Loop Prints Unwanted Extra Paragraph Element
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- How to add in WP_Query to every 3 posts displayed? [duplicate]
- query_posts() doesn’t seem to be called in my page
- Some doubts about how the main query and the custom query works in this custom theme?
- Create a hierarchical loop at predefined markup requirements
- Both WP_Query and get_posts returning 1 post
- Limit the number of posts from a specific category on index.php
- When should you use WP_Query vs query_posts() vs get_posts()?
- Converting an existing query_posts to WP_Query
- Multiple loop for “featured” items returns wrong posts
- Pagination problem with multiple loops on the same page
- How do I correctly query posts from a post ID?
- tax_query not working properly with get_posts
- Show number of posts AND number on current page (cannot make it work)
- Too slow when using both ‘tax_query’ and ‘meta_query’ both in WP_Query
- Use of caller_ get_ posts
- WP_Query, tax_query and term_meta: How to?
- Refine search results using WP_Query
- How to pass many ids in post__in?
- Query with a meta value inside a given range
- How do I run through a WordPress loop called from a filter function?
- How do I get the title of a category in a custom loop?
- Check if loop has any categories?
- WordPress query with items from more than one selfdefined taxonomy as `term` argument
- Get all fields inlcuding “ACF” (Advanced Custom Fields) columns in wp_query
- Pagination not working on custom query on a page
- How does WP generate the default $query in WP_Query based on the URL?
- How I can repeat 2 HTML templates in a WordPress Query?
- Offset WP_Query by negative 1
- WP_Query orderby random do not repeat infinite scroll – one loop
- How to make the ‘request’ filter work?
- How to make a query returning pages from multiple parents
- how to get custom attachment url?
- WP_Query & Duplicate entries
- How to show featured post first, then separate loop for other posts
- WP Query – Show custom posts only if user contain some user meta