I have unique articles set on the homepage and that’s working fine. But on the article page the sidebar shows the article even if it’s on that same article. like if side bar has article 1 and i click on article 1 it will still show up on the sidebar.
is there a fix for this?
thanks
Nope. This would require a more complex dbase query to remove current page from the loop, and you would have to do that for every page.
This would be terribly process intensive.
Which is why you rarely see that on any website.
At least that has bedn my experience.
Please correct me, if this is doable…
Hi,
Please add this code to exclude current post from widgets: http://screencast.com/t/QKs8p0aKk3kI
global $post;
if (is_singular()){
$args['post__not_in'] = array( $post->ID );
}
Thanks!
-
This reply was modified 11 years by
Alin [tagDiv].
One more thing.. Is this also possible with the homepage? I’m using the big featured post from template 6 I believe and I have set it to “unique articles” on the page settings but the sidebar shows the featured homepage image. Is there a way to hide that as well?
Cheers!
Hi,
I also tested this without unique articles: http://screencast.com/t/yTKGSEfdPJ5 but when unique articles are active you should not have articles duplicated: http://screencast.com/t/VmLvAHnYEalV
So this wont be a problem if unique articles are active…I tested this also with Widgetised Sidebar block.
Thanks!
Hi,
Unfortunately this file cannot be overwritten by the child theme.
Thanks!
