• I want to assosiate different sidebars to different (types) of pages.

    I tried to change the “get sidebar” in my page php with:

    <?php
    
    if    (is_page('1')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar1.php");?>';
    
    } elseif (is_page('76')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar2.php");?>';
    
    } elseif (is_page('3')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar3.php");?>';
    
    } elseif (is_page('4')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar4.php");?>';
    
    } elseif (is_page('5')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar5.php");?>';
    
    } elseif (is_page('6')) {
    
         echo '<?php include(TEMPLATEPATH."/sidebar6.php");?>';
    
    } else {
    
         echo '<?php include(TEMPLATEPATH."/sidebar.php");?>';
    
    }
    
    ?>

    (is_page and number is the ID of each page). It seems as the sidebars is there, but they are not visible. Is this code and thinking correct?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Different sidebar to pages’ is closed to new replies.