Web Analytics Made Easy -
StatCounter Listing specific pages on nav bar in Word PRess - CodingForum

Announcement

Collapse
No announcement yet.

Listing specific pages on nav bar in Word PRess

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Listing specific pages on nav bar in Word PRess

    Hello,

    I'm trying to set up my Word Press theme to list only specific pages on the nav bar. For my nav bar, I'm using code for a drop down menu that I found on a site. THe nav bar works perfectly. However, how do I set it up to only include the pages I want?

    I looked at a site and it said to use

    PHP Code:
    wp_list_pages('title_li=&include=4,37,22'
    However, when I use it with my code, it messes up my nav bar. Here's my code. Any idea of what I could try.

    PHP Code:
    <ul id="nav">  
    <?php wp_list_pages('title_li=&depth=1'); ?>
    </ul>  
      
    <?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 && is_page()) { ?>  
    <ul id="subnav">  
    <?php echo $children?>  
    </ul>  
    <?php } else { ?>  
    <?php ?>
Working...
X
😀
🥰
🤢
😎
😡
👍
👎