WordPress Navigation

How to exclude certain pages from a navigation bar WordPress
An important factor in any good WordPress theme is navigation. You can always category page and add widgets to your sidebar, but with a well structured navigation bar (or two) can make a big difference for the visitors to your blog.
Even if you are the favorite subject has made a navigation bar that can not exactly what you need. While a navigation bar may seem something simple at first, there are actually a lot of different things you can do to make sure your site is as easy as possible.
Before anything else, has to settle in what is displayed on the navigation bar. Usually NavBars come in two flavors, categories and pages. Some blogs (as it), using two NavBars, one for each option - or even combine the two into a single line. The one-line approach may or may not work for you, depending of the intricacies of your site.
** Changing the Navigation bar of the pages to the categories (or vice versa) **
There is an easy way you can change what your navigation bar lists, if not currently doing what is needed.
The first thing we do is open the file header.php your subject, either using the theme editor in WordPress "apearance" tab, or download the file with your favorite FTP client.
Your navigation bar is controlled by a template tag, whether or wp_list_categories wp_list_pages.
In the header.php file, find one of those labels. If necessary, simply replace with which you would like to use instead. Most likely not, since there will be some Paramaters parentheses in the label - we'll be adding to this later.
** Finding the ID of the page / category to exclude **
Okay, so he found the label ... Now what? Well, the next step is to modify the parameters of that tag to control which pages are listed. Before we can do this, you have to grab the page specific (s) ID
In addition to the names they give them, WordPress assigned to each category and page a unique identification number. To find that number, pull up the page (or category) edition of your desktop screen. As you hover over each entrance, a row of links will appear, one of them is "edit".
The URL for this "edit" link contains the page / category ID, so just hover your mouse on it and look at the bottom of your browser. Safari users will need to click on that link actually "edit" as the destination URL is not in the browser.
"Edit" URL will end in either "post =" or "cat_id =" and a number. That is the identification number unique to the category page /. <br /> <br /> ** Hide certain pages or categories <br /> <br /> ** Removing an item in a navigation bar is probably the most common changes people make in a WordPress blog. This technique is used for things like private or "hidden" content, as well as a new post paid.
Excluding a page in the navigation bar is easily accomplished by a parameter label navigation. As you can probably guess, we will use what is called "exclusion" of the parameters.
To exclude the page you want, input, followed by the ID of the page / category in question:
wp_list_pages ('exclude = 4,37,22)
In this example, I used list_pages, but it works the same way with the label categories. If you only have one ID, that's all you need to list. In this example actually shows how to exclude multiple pages at once.
Make sure to include the quotes and parentheses, as shown, or the label will not to work properly!
** Only included individual pages / Categories **
In some places it might be easier to see the pages you want to see, instead of the pages that do not. The parameter to exclude work here, but if you have a large site, the collection ID all the other pages might take a while. We should also constantly update the code every time you add something!
Nobody wants to go to do that.
So instead of "exclude", we'll just turn the "inclusion":
wp_list_pages ("include = 4,37,22)
The parameters also include working with the category label.
Note: Changing the order ID on this label will not change the order they appear in your site. Change the page order can only be done in the "Edit" screen, under "Attributes"
** What to do when you have multiple parameters Days **
Most likely, the parameter being added today is not the only one shipping label. The most common parameter in the navigation bar is probably "title_li =. 'This parameter is used to define the title listed at the top of the list.
Generally, a navigation bar does not need a title, so that the parameter is left blank, with nothing after that the sign "=". This is equivalent to saying "do not show any title." Here's an example of that parameter in the action:
wp_list_pages ('title_li =') <br /> <br /> So how combine an existing parameter (s) with your new listing / Exclusion? Like this <br! /> <br /> Wp_list_pages ('title_li = & include = 4,37,22)
Could not be easier!
Just place a "Y" symbol at the end of the existing parameters (s), then add a new one. Please that the group of parameters (called 'string') is included in the quotes. If not configured correctly (see above), will be in trouble!
That's it! That's really all there is to choose which pages to include or exclude from the navigation bar.
Enjoy!
About the Author
Chad is a self-proclaimed WordPress Junkie who works from home with his wife, Lynne. He enjoys teaching and helping others to customize and optimize their WordPress theme, from hidingcategories from navigation bars, to theme customization and 1-on1 coaching.
Scalable WordPress Navigation Using Sort Order
|
|
Zoombak ZMBK200 Advanced GPS Car and Family Locator $249.00 The Zoombak uses a combination of GPS satellite and cellular technologies to more precisely and reliably determine the location of your car or loved ones at any time or place.Zoombak's Advanced GPS Car & Family Locator will help you locate your car, and your loved ones in it, and help bring them home safely. Great for monitoring teen drivers or other family members you worry about behind the wheel... |
|
|
Adobe Creative Suite v.5.0 (CS5) Web Premium 1 User 65068227 Adobe Dreamweaver CS5 Adobe Flash Catalyst CS5 Adobe Flash Professional CS5 Adobe Flash Builder 4 Adobe Photoshop CS5 Extended Adobe Illustrator CS5 Adobe Acrobat 9 Pro Adobe Fireworks CS5 Adobe Contribute CS5 Adobe Bridge CS5 Adobe Device Central CS5 Integrated CMS support in Dreamweaver: Enjoy authoring and testing support for content management systems like WordPress, Joomla!, a... |
|
|
Wordpress $8.57 No Synopsis Available |
|
|
The WordPress Anthology $29.83 No Synopsis Available |
|
|
Using WordPress $21.24 No Synopsis Available |
|
|
Wordpress Bible $42.49 No Synopsis Available |
|
|
Wordpress in Depth $18.33 No Synopsis Available |
|
|
The Mountaineers Wilderness Navigation $14.95 The Mountaineers Wilderness Navigation |
Tagged with: design • navigation • tutorial • webdesign • wordpress • wordpress navigation • wordpress navigation bar • wordpress navigation menu • wordpress navigation plugin • wordpress navigation widget
Filed under: WordPress Marketing Strategies
Like this post? Subscribe to my RSS feed and get loads more!






Leave a Reply