Good day. I need to read on the post page – in proposals to read similar posts, popular, relevant and some other. To do this – so that the proposed post is not repeated. That is, they were not offered again.
How can you remove it, exclude it?
http://start-site.by/22.png
http://start-site.by/33.png
thanks
Hi,
Is that a post page? In the post page there is a related articles section, that will show posts that have at least one category/tag in common with the current post, automatically.
Widgets from the sidebar like blocks for example, won’t exclude the current post, so it may appear there. Blocks display the same content regardless of where they are placed, in a page or in a sidebar for posts. So they won’t exclude posts automatically when they are displayed in a post page.
Maybe this feature will be added in the future, I can’t say for sure.
Thank you!
Can there be a solution to this issue?
I came across this post as well:
https://forum.tagdiv.com/topic/remove-current-post-from-sidebar-widgets/
Can we implement this in our theme?
I have a specific issue given the prominent place of related articles in this post template that we love to use:
Hi,
For pages we have a guide for how to set unique articles -> https://forum.tagdiv.com/unique-articles/
Unfortunately, this option is only for pages.
Hope this will help you!
Yes, it does help on the pages – I was experimenting with pagination.
But the problem has to do with the posts.
Can I add this customisation?
function be_exclude_current_post( $args ) {
if( is_singular() && !isset( $args[‘post__in’] ) )
$args[‘post__not_in’] = array( 1482 );
return $args;
}
add_filter( ‘widget_posts_args’, ‘be_exclude_current_post’);
Or something similar in the widget to override its present behaviour?
Hi,
Yes, a code like that should work, I think that this need to be set in theme functions.php to work, you can use a child theme for this and set the code in the functions.php from there.
Let me know the results!
Will do. Yet the difficulty we are facing is actually targeting the right control. Is it please possible to point the documentation in order to avoid any errors?
<div class=”td_block_wrap td_flex_block_1 tdi_466_fb9 td-pb-border-top td_block_template_1 td_flex_block” data-td-block-uid=”tdi_466_fb9″>
Hi dimitrisv, I just checked again the above code and there you have a specific post that you want to remove, now the problem is like this, that post will be remove but on a different article that post will still be removed and will appear other posts that will be duplicate.
Also I think that you are using the Newspaper theme not Newsmag, if so, then you can use a single post template from tagDiv Cloud Library, edit it with tagDiv Composer and on flex block in filter tab set the settings you want -> https://i.imgur.com/wroFO5X.png
Thank you for your understanding!