Ready to get started?Download WordPress


Side bar- is-page help (1 post)

  1. Josh Holloway
    Posted 4 years ago #

    Hi all, I've searched this forum for the last day or so looking for a resolution to my issue.
    I've got serveral pages with children and grandchildren
    I've created sidebars for each and one of them is giving me hassle.
    I need to create an if statement for a sidebar that spans around about 100 pages.

    if (is_page() ) {

    is the basic layout however I need the sidebar to only display on these pages. I can't specify ID's because I'll be here for weeks.
    Is there anyway that I can put a variable in that basically says $thispage = child_of(array(1,2,3,4,5))
    The numbers in the array would be swapped for the parents of the pages I wanted to have the sidebar on.

    Sorry if this is confusing.


Topic Closed

This topic has been closed to new replies.

About this Topic