Choose WordPress Pages Displayed In Navigation Bar

If your blog has a navigation bar in or near the header and you create a lot of pages on your WordPress blog chances are it is getting somewhat cluttered. You can control what pages are displayed by including the ones you want or excluding a certain few. Here is a short to help you clean things up.

Warning before editing any theme files make a backup so you can fix any mistakes!

The first thing to decide is if you are going to include certain pages or exclude certain pages. Each page has an ID number associated with it. To find the page’s ID numbers in the dashboard click Manage, Pages and look for the ID number of the page. Next open your header.php file and look for this code:

<?php wp_list_pages(’depth=1&title_li=’); ?>

That bit of code is going to display all the pages you create. To exclude certain pages use the below code in its place and add the page ID numbers comma separated. The example below is excluding page ID 6 and 4.

<?php wp_list_pages(’title_li=&depth=1&exclude=6,4′); ?>

To include only certain pages you can try this next bit of code:

<?php wp_list_pages(’title_li=&depth=1&include=6,4′); ?>

There are many more parameters to list pages, learn more about WordPress page navigation here: WP List Pages

You can also ‘hard code’ any URL in the WordPress navigation bar as this previous post explains: Specify WordPress Navigation Page Links

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

11 comments so far

WordPress 404 Redirect And 404 Custom Message

The WordPress 404 error page or the 404 error message is probably the file or piece of code most neglected by WordPress theme authors. This short WordPress guide will show you how to spruce yours up a bit.

Read this article ->

WordPress General Options Guide

A WordPress guide for the genearal options panel. One of the first things that should be done for a new WordPress blog is to configure the general options. The Blog name, tagline, blog address, email address, date and time as well as allowing others to register and comment on your blog should be one of the first things done after a new WordPress blog is installed.

Read this article ->

Adding and Changing WordPress Themes

One of the first things a new WordPress blogger wants to do is make their new WordPress blog look the way the want it to. Adding a cool new WordPress theme and then maybe even customizing it a bit. But before you add a new theme and start looking for someone to “pimp your blog” I suggest you try several different themes see how the work and look for a while. Once you are sure you like the theme then get that custom header made and installed, and learn how to tweak it over time.

Read this article ->

Removing The Title of WordPress Pages

Removing the title of the page that appears just above the content may be something to consider if you are using static front page or just want a page on your blog that looks a little different than the rest of your WordPress pages. This short WordPress guide will give you some idea what to remove from your page template file.

Read this article ->

Have Your WordPress Stats Stopped Working

If your WordPress stats stopped working or if WordPress stats don’t work on your blog it may be due to some missing code in your themes footer file. The fix is very simple.

Read this article ->

How To Add AdSense Ads To A WordPress Blog

Placing Google AdSense on your WordPress can be accomplished in a variety of ways. Because of the big blogging rush happening right now many people are building blogs to make money blogging. And the first thing they want to do is to put Google AdSense on their blog.

Read this article ->

How To Add BlogRush To A WordPress Blog

If you have a WordPress blog, or any blog for that matter, chances are you have heard of BlogRush. BlogRush is a traffic generation strategy specifically for blogs. The porpose of this WordPress Guide is to show you how to add the BlogRush widget to your blog.

Read this article ->

Next Page »

Close
E-mail It