[resolved] Editing The Header To Show Only One Page (3 posts)

  1. johnwillis
    Posted 8 years ago #

    Hi guys,

    My site http://essentiallinux.org has the Hi-tech theme in use. I want to stop every page but the "Contact Me" page displaying in the header as they are already listed in the sidebar (which is where I want them to be). So I looked in the code for header.php and it looks like it's using an array of wp_pages or something similar to create a list of pages to be put in the header.

    My PHP knowledge is limited at best so does anyone know how to fix it so I can just show Page ID - 2?? (The Contact Me Page)

    I have included the section of code from my header.php if that helps.



    <div id="HEAD">
    <div class="Wrapper">
    	<div id="SEARCH">
    		<?php include (TEMPLATEPATH . '/searchform.php'); ?>
    	<div id="TOPNAV">
    			<?php wp_list_pages('title_li=' ); ?>
    	<div class="Visual">
    		<h1><span><a href="<?php echo get_option('home'); ?>/"><?php bloginfo('name'); ?></a><br/><b><?php bloginfo('description'); ?></b></span></h1>
  2. yakuphan
    Posted 8 years ago #

    Change like this
    wp_list_pages('include=2&title_li=' );
    If you want show 2, 4, 8 etc. you can use this code like,
    wp_list_pages('include=2,4,8&title_li=' );

  3. johnwillis
    Posted 8 years ago #

    thank you so much for your prompt reply. as you can see from my site it has worked perfectly.

    many thanks yakuphan :)


Topic Closed

This topic has been closed to new replies.

About this Topic