How to exclude Pages from Navigation ?

Previously, I mentioned you How to exclude Categories from Navigation. Here its almost the same thing I’m going to do again, with just a replacement of single word. We can exclude Pages from Navigation easily. But with that I’m also going to tell you the easy way, that’ll help you exclude your required pages with just a single click. Yes, by using a simple Plugin.

Jump to the Easy Way

Or read ahead How you can do it manually !

This simple edit in the code will help you do so.

The Default Code:

<?php wp_list_pages(’title_li=&exclude=’ . $ex_aside) ?>
  • We’re just going to repeat the same steps We did for Categories.
  • Find the above code in Header.php of your theme file.

Replace it with this code:

<?php wp_list_pages(’title_li=&include=20,39?);?>
  • In the above code, 30 and 39 are the IDs of your Pages. Only add IDs of those you want to show in navigation. Rest will be excluded.

 

The Easy Way

Exclude Pages:

This plugin adds a check-box, “include this page in menus”, which is checked by default. If you uncheck it, the page will not appear in any listings of pages (which includes, and is usually limited to, your

page navigation menus). 

Working:

After installing this Plugin,

A menu like this image will be added below the categories panel at your Write-Post page. While writing any page, just select the check box if you want that page to show in navigation, leave blank to exclude. That’s it ;)

Add a Comment

Your email address will not be published. Required fields are marked *