• Here is the code. Current code will display all the header in same page.

    <?php if ( is_page(‘1’)) {} include(‘header1.php’);?>
    <?php if ( is_page(‘2’)) {} include(‘header2.php’);?>
    <?php if ( is_page(‘3’)) {} include(‘header3.php’);?>

    How to make
    When page 1 will not do page 2 and 3
    When page 2 will not do on page 1 and 3
    When page 4 will not do page 1 and 2

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
    if ( is_page('1') ) {
    	include('header1.php');
    } else if ( is_page('2') ) {
     	include('header2.php');
    } else if ( is_page('3') ) {
    	include('header3.php');
    } else {
    	include('header.php');
    }
    ?>

    The final else assumes a header.php, which again assumes is something you want to provide at all other times. Including for Page 4…

    Thread Starter blogtools

    (@blogtools)

    Thanks Kafkaesqui.. yes it work. but its not work on child page.

    i put on page.php

    <?php
    if($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    
    <ul>
    <?php echo $children; ?>
    </ul>
    
    <?php } ?>

    when click on child page menu on current page. the header will not show and just get naked content.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help on is_page’ is closed to new replies.