2
Exclude Current Post ID
Source: elementor/elementor#33377 · opened by @pixelloop
Describe the Problem In the Loop Grid, you have an include and exclude option. In the exclude option you have a toggle for "Avoid Duplicates" You should have a toggle for "Exclude current post ID". Often I will use a Loop grid at the bottom of the single post template or a single template for a custom post type and I want to show 4 or 8 other posts but this often ends up showing the post they are already on. Propose a Solution Add a toggle button underneath Avoid Duplicates that gets the current page ID and removes that from the query. Additional Context Only solution is to use custom PHP snippet at the moment: add_action('elementor/query/exclude_current_case_study', function( $query ) { if ( is_singular('case_study') ) { $query->set('postnot_in', [ get_the_ID() ]); } }); Then add the Query ID exclude_current_case_study to the Loop Grid. It should be a basic setting like other page builde…
No pledges yet. Be the first to back this.
Comments
Similar requests
🚀 Feature Request: Add support for Post Formats in the Posts and Archive Posts widget
1 vote · 0 comments
Add New Dynamic tags in Elementor Pro
7 votes · 0 comments
🔗 Include/Exclude taxonomies from the Taxonomy Filter (Related to #23418)
37 votes · 0 comments
Add 'hide latest post' option from the blog overview so it isn't duplicated on the main rotation
2 votes · 0 comments
Styling Links / custom CSS : exclude Header and Footer
4 votes · 0 comments
No comments yet.