Specific support for third party plugins are off topic, but your question can be answered in a general scope. get_the_ID() will not work for this specific issue, what you need is an array of post ID’s that is currently being displayed on the page you are viewing.
The current array of posts that is being displayed on any given page is stored in the $posts property of the main query or any custom instance of WP_Query. It is from here that you would want to extract all the post ID’s from to pass to $args['post__not_in'] in your code in question.
You can try the following in your code above
global $wp_query;
$post_ids = wp_list_pluck( $wp_query->posts, 'ID' );
Then you can feed $post_ids to $args['post__not_in']
$args['post__not_in'] = $post_ids;
You just need to pass the correct conditionals to target your specific pages
Related Posts:
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Plugin upgrading: Widget settings
- Simple rich text editor in Text widget?
- Need to create a Theme demo site that features multiple themes
- Override dynamic_sidebar() in plugin?
- How do I add a widget programmatically to a newly created site (WPMU) within a plugin?
- How to place random widgets in the WordPress sidebar?
- Override Widget class in plugins with custom plugin
- Pages with 2 Columns
- Can I ignore caching of a plugin in W3 Total Cache? [closed]
- Why is the unrendered widget number `__i__` showing up in the JavaScript but not in the HTML?
- Custom Widget Creating PHP Exception When Placed In Its Own PHP File
- register child class in another plugin
- Themes VS Plugins [duplicate]
- Changing widget options via the functions.php when there are no hooks
- Conditional Display of Links in Widgets
- How to Get Admin Settings for a widget when using the_widget() with custom widget
- Created Widget Not Showing up on Admin Panel
- Setting up widgets in wordpress with a unique ID for the after_title argument
- Flickr plugin that will display photos from multiple group pools? [closed]
- WordPress author details plugin/widget
- WAMP to XAMPP WordPress transfer
- The plugin generated 3 characters of unexpected output during activation
- Get post values of form created by widget in sidebar
- Multi language site [closed]
- How to style the RSS wordpress?
- How can I disable widget from being visible on some pages?
- How to display more than one instance for a widget?
- Custom random quote widget breaks when used in multiple sidebars
- Hooking in to replace the Sidebar/Widget areas
- How to add media field to WP_Widget form function?
- changes to widget settings not showing up in individual pages pages until they’re updated [closed]
- How to hide CSS by default and show on button press
- Widgets Scripts don’t load – but load when I reload the page
- Setup page on first login on multisite
- How can I inject options into an select tag inside the widget form?
- Add content to footer – above wp_footer
- How to add wp visual editor in a custom widget?
- WordPress Widget – Saving multidimensional arrays into $instance
- Conditional tag in Widget Logic for checking if top level page or if subpage
- Char limit on custom blog-post form? [closed]
- How do I use wp_editor() in widget form?
- How to reorder and display a feed to be chronological?
- How to add Wrapper Div/container element around WordPress Widget Content
- Disabling plugin but wpenqueue is not available
- Related posts widget or plugin needed
- Problem since update 3.5 [duplicate]
- How to disable a widget when dependent plugin is inactive?
- Best practice for including plugin output in a template without using shortcode?
- How can I delete a wordpress widget instance?
- Saving widget options from class method
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Short messages widget [closed]
- Widget’s container?
- Add SideBar/Widgets Just Below the Post
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- WordPress Widget Not Saving Instance
- How to display a widget on a page with no theme?
- Widget where it can make changes to the container
- Widget content turns up before title
- Modify pages widget and make a plugin?
- wp_footer hook running twice
- jQuery slider widget similar to cnet.com
- Why aren’t my Follow Me links working?
- Is there any plugin to show number of clicks on the link?
- co-authors plugin – inline listing
- How can I display selected content from a seperate database in an Activity style widget?
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Change language in SiteOrigin Widgets
- elementor development – custom widget like an inner section widget
- Some Widgets in the Right Side Bar and the whole Footer section is not working in a WordPress Site
- Using foreach loop for `$instance` of form and update array widget iteration
- One time call to external API in widget
- Shortcode generated widget to appear on same line as heading text and button
- How do I keep children of certain parent menus expanded by default on a sidebar?
- Registered sidebar area is not shown from plugin.
- Widget logic using woocommerce product category
- Custom content per post in widget
- Using slightly modified widget
- How to make wp multisite subdomain exist search
- Plugin Works, but Widget Doesn’t
- Widget Script Loads at Bottom of Page
- Use of apply_filter in plugin/widget class
- jquery conflict with widget page
- Template from scratch: Sidebars not showing widget
- Widget redirecting to home page
- Plugin won’t activate, fatal error (widget class not found)
- WordPress plugin not eching popular posts
- Trying to output a “Most visited blogs” list in wordpress multisite
- How to use template field in the Event Organiser plugin widget
- How to develop an extension for a simple form post and post back? [closed]
- How to add homepage Widget?
- What can I do to customize a widget provided with this plugin? from where have I to start?
- Is it possible to control content on different pages by checkboxing wich content is shown where on a wordpress theme page?
- Content expands beyond its column container [closed]
- Am having issues intergrating this api into my wordpress site, any help please?
- How can I add a zip code service availability checker in WordPress without Woocommerce? [closed]
- Use custom Javascript for a custom Elementor Widget [closed]
- Why my widget is not visible in the WordPress theme Twenty Twenty-Three
- Hide attributes based on previous selection