I’m building a custom theme. My sidebar shows ‘adverts’ that lead to a post in category 5 and the main column shows all other posts and categories except category 5.
Here’s the thing:
When someone clicks on the post ( ‘advert’ ) in the sidebar and we go to that post’s ‘single’ page, how can i prevent the post being shown in the sidebar?
i think the code needs to say:
if – anything in the sidebar loop = the current page id, skip it.
does this sound right? how do i do that in php?
- The topic ‘No repeat posts ( in sidebar )’ is closed to new replies.