• I think I’m close on this but…

    I’m trying to get 4 pages that need different sidebars to appear at the main sidebar for that page(1,2,3,4). Each of those 4 pages have child pages under them. The child pages need to have the same sidebar as the parent pages.

    In our pages.php file we have

    <?php
    
    if (is_page('28') && $post->post_parent =="28") {
    	include ('sidebar-1.php');
    } elseif (is_page('36') && $post->post_parent =="36") {
    	include ('sidebar-2.php');
    }  elseif (is_page('38') && $post->post_parent =="38") {
    	include ('sidebar-3.php');
    }  elseif (is_page('24') && $post->post_parent =="24") {
    	include ('sidebar-4.php');
    }
    	else{
    	include ('sidebar.php');
    	}
    ?>

    I’m stuck in getting the parent pages to show the correct sidebar, however the child pages do show them correctly.

    Any ideas?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Different sidebars in different pages and subpages’ is closed to new replies.