FeatureFuel
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.

Make a pledge

Pledge your monetary support if this feature is added.

$

Comments

No comments yet.

Replying to

Add a comment

What do you think about this feature request?


Similar requests