Hi i’m using wp as a basic cms for a small site mostly created using pages.
I’m currently trying to make the sidebar change content based on site “section”.
I’m using is_page(X) tag which works fine but i have to set up a conditional statement for every page ( if….elseif…elseif etc.), also for child pages.
The_Question: is there any way to manipulate page branches? I’d like subpages to show the same sidebar content as their parent (parent and child make 1 “section”) without having to add them manually using another “elseif”.
This way i won’t need to make any change if a subpage is added and the code would be tidier. I really hate wasting lines!
- The topic ‘context aware sidebar’ is closed to new replies.