Customize WordPress Header Navigation Bar

Here is an older post from November 2008 that should still be relevant today for tweaking the navigation bar on WordPress themes that have one. Sorry but I will probably not answer any questions about your specific theme.

Adding too many pages to a WordPress blog that has a navigation bar in the header can really make your WordPress blog a mess. There are options to control what pages are shown in the navigation bar and even a way to add external links.

First things first and that is the difference between WordPress pages and posts. Posts are part of the blog loop and usually show in chronological order with the newest on top. Pages are static and don’t show in the loop. Links to pages are usually displayed in a sidebar widget and in a navigation bar in the header if the theme has a navigation bar. Pages should be used sparingly unless you are going for a more traditional type website.

The file to edit is typically the header.php file and I usually edit theme files right from the dashboard’s theme editor. On some hosting accounts you may need to make the themes files writable to do it that way. Or you can use FTP to download the file to your computer, edit it with a text editor like Notepad or Wordpad and then upload it again. Another option is to edit the file in your hosting accounts control panel. The path to the header.php file is:
WordPressFilesDirectory/wp-content/themes/YourCurrentTheme/header.php

The code to edit the navigation bar is almost always in the header.php file and it is typically very easy to find the proper code. While the navigation bar may have a different name than the example below, the clue is in the part of the code we are going to edit. In the example below the navigation bar is pretty easy to spot <div id=”navbar”> sometimes it is called Menu or whatever the theme coder decides to call it. The example below is first showing a Home link and then all WordPress pages.

<div id=”navbar”>

<div id=”navbarleft”>
<ul id=”nav”>
<li><a href=”<?php echo get_settings(‘home’); ?>”>Home</a></li>
<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order’); ?>
</ul>
</div>

A little added code can either include or exclude any page or pages but the first thing to do is find the page numbers of the pages you want to include or exclude. If you don’t have custom permalinks you can just view the page and look at the URL in the address bar of the browser to get it. If you are using custom permalinks you need to open the page in the WordPress dashboard editor to see the actual page number in your browser address bar. Since the WordPress dashboard menus changes so often anymore I will not give specifics how to edit a page. Lets just say if you can’t figure that out you shouldn’t be messing with the themes files! Once you have the page open in the page editor look at your address bar for the page number. The trailing URL should look like this: page.php?action=edit&post=67. Yeah I know it says post but that is the correct number, in this case 67.

The code to add to the header.php file to include only pages 67 and page 68 will look like the examples below. You can add as many page numbers as you want in a comma separated list, or just one.

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&include=67,68′); ?>

Look closely at the difference between the first example and the added code in the second. The code added was this &exclude=67,68 with no extra spaces and keeping the ‘ at the end.

To exclude certain pages from appearing in the navigation bar simply use exclude instead in include in the code. The example below will not show pages 67 and 68:

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&exclude=67,68′); ?>

Now what about sorting the order the pages are shown? Well there are options that you can use and these are found on the WordPress codex. But if none of those options work for you you could use the includes code multiple times to set the order on your own. For example this would show page number 67 first then page 1 second:

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&include=67′); ?>

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&include=1′); ?>

Did you notice the code for the Home link in the first code example? I bet you are thinking now right? Yes that is the code we can learn from to hard-code external links. This part is very simple just place the code for the external link anywhere within the navigation bar you want the link to appear. In the sample below the Home link is first, page number 67 second, an external hard-coded link and last is page number 1.

<div id=”navbar”>

<div id=”navbarleft”>
<ul id=”nav”>
<li><a href=”<?php echo get_settings(‘home’); ?>”>Home</a></li>

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&include=67′); ?>

<li><a href=”http://www.wordpressmax.com/” title=”WordPress Guides”>WordPress Guides</a></li>

<?php wp_list_pages(‘title_li=&depth=2&sort_column=menu_order&include=1′); ?>
</ul>
</div>

Things To Consider:

  1. All WordPress themes are coded differently so your code might look different than the examples above.
  2. Always, always make a backup of any theme file before you attempt to edit it!
  3. These changes are theme specific and will need done again if you switch themes.
  4. Yes it is possible to add a navigation bar to your theme, but please don’t ask in the comments below, that will be a post for another day.
  5. Sorry I can’t “look at” or edit your navigation bar for you unless you want to compensate me for my time. I have tried to help out as much as possible but a few have taken advantage of my time.
  6. More information about template tags for listing WordPress pages can be found here: Template Tags/wp list pages

Similar Posts:



Tags: ,

If you liked this post, feel free to leave a comment that is relevant to the post or subscribe to the feed and get future articles delivered to your feed reader.

Sorry but due to the spamming of a few all comments are moderated and will appear when approved and all drive-by comments will be deleted!

Comments

thanksfor the article. This is what i’ve been looking for

Reply

Hey I love this post. I’m fairly new to WordPress and it always amazes me to see how much can be done with it. I’ve always been afraid to mess around with code but your posts are very clear. I’ll be bookmarking this post for reference.
Thanks gain

Reply

I like the wordpress most and this is the good post for those who have been waiting for this including myself.

Reply

That makes many things possible with wordpress. For example a company website.

Reply

Nice post Jeff, very informative, precise and clear.. Thanx for sharing this post of yours with everyone. Peace

Reply

I was precisely looking for how to add external links to the top menu. I am glad I found it here. Many thanks for sharing this valuable information.

Reply

I found the ‘Exlude Pages’ plugin very useful

Reply

Jeff, I have searched for many hours looking for straight forward instruction on customizing navigation bar. Your article is by far the best I have found. And with your help I was successful in adding a external link to my website. Thanks for a great article.
Brad

Reply

Now I learned where I can find the navbar, however I don’t know how to make a fancy navbar. Any help would be appreciated.

Reply

Jeff, you are worth the Nobel Prize of WordPress guidance. Shall I suggest that?

Reply

Man, you are a lifesaver. I have looking for something like this for a while. Thanks.

Reply

hey thanks for the code !! it works wonderfully !!
i was wondering if a separator can also be inserted b/w pages (for instance something like: “|”)for the footer links…

Reply

Jeff  Replied:

Why not try it?

Reply

YOU ARE A CHAMP! Thanks for this properly detailed explanation.

Saved my life.

Reply

Related Post Request:

How to Remove All Navigation in Top Bar, but Only on Custom Page Templates.

The idea here is create custom landing pages that focus attention on a single action… (ex: request download, opt-in, etc). From a marketing standpoint, you do not want any other clickable distraction on the page. However, you want to keep consistent design elements.

Whole themes are being designed and sold for just this purpose. Example: http://www.squeezetheme.com But wouldn’t be simpler to create custom page templates with no navigation that already have your site’s look and feel??

Thanks much!

Reply

Jeff  Replied:

It can get tricky trying to explain that on a generic basis. It could be done by leaving off the nav bar code but then that may throw off other elements of the theme. Since all themes are coded so differently it can get complicated.

Reply

I’m trying to add just one category to the top nav of my site. I know it should be simple but for some reason have not come across anyone who’s discussed it.

Currently the top nav has the list of pages, which is fine. I want to add one category so that it’s easier for people to find the posts concerning the topic.

Have you seen anyone write a tutorial on it? Or you perhaps?

Thanks!

Reply

Jeff  Replied:

Its a matter of adding the correct code to pull the category you want. I found what you needed by searching “Add Categories to WordPress Navigation Bar”.

Reply

Excellent reference! I’ve done some PHP before, but haven’t touched it in ages, and this is a really nice refresher + guide to show novices like myself how to edit code…(got rid of an annoying ‘double’ home page on my site).

A million thanks, Jeff!

Reply

Jeff, thanks for sharing. Something that I have found to be invaluable in doing my WordPress theme edits is the free Firebug plugin for Firefox. If you aren’t already using it I’d highly recommend checking it out.

Reply

Jeff  Replied:

I use it a lot too.

Reply

Thanks for the information, Jeff. This is a good reminder. I have had this very issue in the past. Too many links in the upper link bar screwed up the outlay of my blog and made it look horrible.

Reply

Jeff, this is something I was looking for a longer time.

Honestly, you helped me to show a way to customize my website which is hosted on wordpress.

This code is really useful and I hope you will be providing much more information in Future.

Thanks!!

Reply

Thanks for sharing this again. Your old posts never loose their gleam..they’re still useful today as they were before.

Reply

Hello! I love this post. I’m new to wordpress and it always amazes me to see how much can be done with it. I’ve always been afraid to mess around with code but your posts are very clear. I’ll be bookmarking this post for reference.

Reply

I found the ‘Exlude Pages’ plugin very useful. I am a php developer. I like your post and in future i would expect from you more interesting post. Thanks for sharing.

Reply

Just learned how to use the navbar, but wondering on how to make is fancy?

Reply

Man, you are a lifesaver.
I have looking for something like this for a while. Thanks.

Reply

My friend is using wordpress for creating a Blog… he says it’s easier and faster.

Reply

I’ve been looking to update my header information on my blog. Your post was very helpful Thanks

Reply

I’ve been trying to change the blog title font on one of my sites, and I’m about to either pull out my hair or throw the computer out the window. I downloaded a template and followed the instructions on how to customize the header. I can change the header the way I want it, but I can’t figure out how to add it to the template. I save the header.php file with the name that I’m supposed to, but it doesn’t change the file once I activate the theme. I hate to use the default font because it doesn’t look professional.

Reply

Jeff  Replied:

Keep trying and learning or pay someone to do it for you.

Reply

Jeff thanks a lot dear , I was searching for this for he last three days and finally I found your blog .You done a good work.

Reply

This is a really cool website. Are you using WordPress as your main platform? I ask that because your website looks a little different…

Reply

Jeff  Replied:

Yes it is all WordPress.

Reply

I was seeking to add links to external top menu. I’m glad I found here. Thank you very much for sharing this valuable information.

Reply

thnx..This is a good reminder. I have had this very issue in the past. Too many links in the upper link bar screwed up the outlay of my blog and made it look horrible.

Reply

Hey I love this post. I’m fairly new to WordPress and it always amazes me to see how much can be done with it. I’ve always been afraid to mess around with code but your posts are very clear

Reply

I found the ‘Exlude Pages’ plugin very useful. I am a php developer. I like your post and in future i would expect from you more interesting post. Thanks for sharing

Reply

I find all your pages very helpful. I stumbled across this site about a week ago and bookmarked it. I recently came back and looked at all your info…absolutely awesome. I have more than i ever needed to know about wordpress here. Amazing guides and great advice. I can’t really say what i find super useful because it all is! But i would have to say like others the Exclude pages plug in is super useful. Thanks for the awesome guides!

Reply

I was precisely looking for how to add external links to the top menu. I am glad I found it here. Many thanks for sharing this valuable information.tnkss admin

Reply

Thanks for the code- it will be well used by me!
My friend prefers Joomla! to WordPress, claiming it’s too hard to configure. I’ll be sure to show him this post and prove him wrong :-)

Reply

Awesome Tutorial dude. Will use it in my wordpress blog.
Thanks for it.

Reply

I think the new navigation system (from Woo) will make navigation a lot easier in version 3.0, but this is still relevant in my mind.

Reply

Hello! I love this post. I’m new to wordpress and it always amazes me to see how much can be done with it. I’ve always been afraid to mess around with code but your posts are very clear. I’ll be bookmarking this post for reference.

Reply

Thanks for this Jeff, I own a few WordPress sites which have a few pages and had no idea how to fix the headings, this is one post which I have bookmarked!

Reply

Thanks for this. I started my blog site (www.biketrackdays.net) just yesterday and got stumped on the menu bar. Will hit it again next week. Thanks again.

Reply

Hi

Many thanks – used this code and it worked a treat. Made me feel like a programmer :) Well actually I am a programmer, just not a PHP one!

Neil

Reply

Thank you. I’m trying to design my own WordPress theme and this is very helpful. It’s confusing but nice guides like this tend to make stuff much easier! Thanks!

Reply

Hi Jeff,

Good post! I wish could have found something like this when I first started messing around in WP. After many hours later and numerous site rebuilds, I have the hang of wordpress and have become quite the expert.

Ryan D
CEO
My Biznez Inc.
Affordable website options for your business

Reply

Great tutorial man..I was thinking how to exclude page from appearing in the navigation. It’s so simple and I did not have the idea. Thank you very much..

Reply

Hi Jeff,
I love your posts. I don’t have a lot of wordpress experience but with most for most of my questions I found the right answer here.
Kiss

Reply

i love how much your posts helps noobs like me. thanks for taking the time and helping guys like me!

Reply

Hi Jeff, thanks for making sense of WordPress for me. Still getting to grips with it but it’s a little clearer now so good work!

Reply

This is a good information for every wordpress users. But I think, things changes this time because their already wordpress themes that are already customized this kind of features.

But anyway, this is a good one though.

- Felix Albutra

Reply

Now with the WordPress 3.0 launch this thing will get easier. You can create a menu directly from the admin side.

Reply

Thanks for posting this jeff, I really needed this done to my blog.

Reply

Thank you for you great post. This is very helpful to me b’coz im trying to design my own WordPress theme. Awesome Post.

Reply

Your post really shows the flexibility of wordpress. 3.0 should make it a full CMS

Reply

Thanks for such informative post. i was looking for it from last 2-3 months. You make my task easy, I’m so happy to have your blog. Thanks a lot, keep on like that. From now I’m a regular user of your blog.

Reply

I am new WordPress and appreciate all the tips and help i can get. Thanks for the detailed tutorial on how to customizing the navigation bar. Especially useful were the code snippets.

Reply

I’ve not switched over to WordPress 3.0 yet so this advice is very helpful for me.

Reply

thanks, i got an idea how to customize a drop down navigation

Reply

Hi, great post & very useful, but I was wondering how you would go about sorting a nav bar or menu bar alphabetically but still keeping the home page 1st.

So in effect excluding the home page, but sorting all other pages.

Reply

Jeff  Replied:

Add the links manually.

Reply

Hey thanks for sharing this. On one of my wordpress blogs I had made one of the pages a static page so I could have a welcome message on the front page. The only thing was that when I did that I had “home” and the name of my static page in the nav header, but they went to the same place so it was kind of weird. So, I had to do away with the static page and do a sticky post, but with this little tip I could do it the way I had it originally. Thanks!

Reply

you have no idea how appreciative i am for this. MANY many thanks! cheers!

Reply

Great subject… on larger WordPress sites… like in excess of 50 pages, the nav bar can get over-crowded quickly if it is not organized properly. As you suggested it can make the whole blog look like a mess. I saw a few commenters mention the various exclude plugins and you gave some solid examples of the exclude in php code for the programmers out there. On the newer Studio Press premium themes now there is a really nice dashboard feature to allow you to control the nav bar and the subnav bar all from one place. So cool. On bigger sites I land up making a text file with a list of every post and page and their ID numbers to get the nav and subnav bars organized. When I add pages or posts to the site I update my master list of pages. This way it’s easy for me to generate an exclude list. On a lot of sites I will use pages on the nav bar and post categories on the subnav. OK Regards – Mal

Reply

It looks complicated… however, I’ve got to admit you’ve done a nice job of bitesizing the info, I think I’ll be able to follow this for my blog!

Reply

Don’t worry Plastic, I’ve followed and works great, thanks Jeff!

Reply

I don’t usually fool around with headers, but this makes it easier. As always, I’m afraid I’ll do something to my blog and never be able to fix it!

Reply

I’ve done my fair share of tinkering with the code in a few of my wordpress blogs in order to clean up that Header Nav bar. After all this time and effort I had yet to get one to look the way i wanted it, Until now. I am greatly appreciative for this little guide.

Reply

I recently moved to WordPress.com to WordPress.org. I am using Thesis as a theme. Do you recommend this coding for navigation item will work for all the themes. I am currently developing custom theme for my existing blog. What do you suggest shall I wait till my new design is completed and then apply this technique or apply this technique now.

Reply

Jeff  Replied:

All themes are coded differently, this post is a basic guide but your particular theme may vary. As far as when to work on your theme… sorry I can’t think for you too.

Reply

Great post. I’ll be doing the move from org to com pretty soon and I’ve been using posts like this to get everything ready. Thanks.

Reply

hey jeff ! thanks for sharing the above code for navigation toolbar i have been working with it for a longtime and has made my wordpress theme look good .

Reply

I have had one of my blogs for a while and I think my navigation bar was all bogged down because of that.

I’ll get around to trying this shortly. I’m hoping that will give it a more uncluttered look.

Ed

Reply

Don’t worry Plastic, I’ve followed and works great, thanks Jeff!

Reply

Thank you sooo much for this post, it helped a ton. Keep on doin what your doin!

Reply

The code is useful. Thanks Jeff! I’m learning it now!

Reply

Thanks for the article. I have been trying to do the same for a while but without much success. The step-by-step advice helped me immensely, though a few things you mentioned don’t tally with the theme I use (different themes are coded differently, so no surprise). Thanks again :)

Reply

Just what I was after, I’m a web-design noob and this was explained well, thanks.

Reply

Recently, I have been learning exlude Pages , read the article, benefited a lot.

Reply

I’m not a WordPress expert. This has been very helpful to a neophyte like me. Keep it up!

Reply

Hey jeff, I like your tutorial for customizing the header. I have just started using WordPress, therefore it is helping me a lot in my website. Keep posting such good tutorials.

Reply

Thanks for the informative post and for actually replying to your readers’ comments. That’s something I don’t see very many blog owners doing and that makes me frustrated. Keep up the good work and I’ll continue coming back here to learn more about customizing my WordPress sites.

Reply

Thank you very much for sharing. I would really like to customize my wordpress header navigation bar soon and fortunately, I have stumbled on your blog.

Keep it up!

Reply

Best solution I found yet thanks.

Reply

Backup is very important for any work with the site. Thanks for explanation)

Reply

Thank you for sharing,… have managed and uses wordpress once for my blog, and I find it hard customizing it..but now that I have these details on how to do it, think I’ll have to give it a try for my other site…the codes that you have posted where useful and for sure that could give me a big help.. thanks a lot.

Reply

I been searching on how to customize my blog Header Navigation Bar, I am thankful that I found this post. Thanks for this article. I tried it, very amazing thanks..

Reply

I am a novice and have been wondering whether customizing the navigation bar is possible. Thank you for the great, detailed post on how to get the navigation bar I want. Also refreshing to know is that this process remains the same after two years. This convinces a beginner like me that perhaps I didn’t get into the blogging game too terribly late.

Reply

Wow, thanks for sharing. This issue has been driving me mad (actually, nearly literally) and the bigger my blog has got, the more of a mess it seemed to look.

Reply

How is it that I’ve never been able to find the answer to this header dilemma I’ve faced for years. I have a few blogs I’m in the process of attempting to fix with your suggestions/methods; I hope they work, and I’ll let you know if they do. Maybe I’ll have to hire you for your services. Thanks!

Reply

I was what I was looking for on how to add external links menu. Late to the party but glad I made it.

Reply

Yep… thats about sums it up and it’s not that difficult… but remember… Things To Consider number 2!

Reply

I followed your tutorial and it worked perfect. The personalized navigation bar was exactly what my blog was missing. I’m so glad you took the time to make this available.

Reply

Sounds like an interesting tutorial site. I am for one needs more learnings for wordpress, especially on header navigation. I hope to learn more on this.

Reply

sounds like i have to try this one :)
Thanks for putting together this great post – some very good points here that all bloggers can start implementing.

Reply

Looks complicated… Can I apply this method to change navigation menu in thesis theme ?

Reply

Jeff  Replied:

Only way to find out is to try.

Reply

Hi Jeff…. you are worth the Nobel Prize of WordPress guidance. Shall I suggest that? thanks for sharing…

Reply

hey jeff ! thanks for sharing the above code for navigation toolbar i have been working with it for a longtime and has made my wordpress theme look good .

Reply

This article is awesome. I have been looking for this explanation. I really afraid to add many page, because my header look bad. That is why I just put one link into it. Thanks for the info.

Reply

really looks more easier with your code thanks

Reply

Thanks for this, I find the whole editing of wordpress themes beyond daunting as I have very little HTML knowledge, but it seems at least a task a human can attempt now!

Reply

I’d say this thread is an oldie but a goodie, I’m new to wordpress and am looking to expand my knowledge. Cheers on the pointers here.

Reply

The level of customisation available to WordPress is remarkable – I love it.

Reply

Thanks for sharing a useful information, anyway how if we are not using header navigation? Will it affect to our blog SEO?

Reply

Jeff  Replied:

I don’t think the navigation bar has any effect on SEO.

Reply

Narmadi  Replied:

Thanks for the response

Reply

I just did it to my new blog, it’s a great tips for a company blog to make it “more” like a company website. Though it has nothing to do with SEO but appearance is always an important element of a web page.

Reply

thanks for sharing this usefull information. i just set up a blog on my site and have been trying to customize it. this will really help me. thanks again

Reply

Thanks so much for this! You saved me some serious headaches! Starting a new blog and I needed to customize the header navigation.

Reply

I just learned how to use wordpress, and thank you Jeff for this helpful information. I’ll try it later.

Reply

I love wordpress too, there’s so much you can do with it. Thanks for the tip Jeff, going to try it now with my latest blog.

Reply

Wow !!! Excellent reference! I’ve done some PHP before, but haven’t touched it in ages, and this is a really nice refresher + guide to show novices like myself how to edit code. Thank you for this great article

Reply

Thank you for the extremely thorough and informative post. I am often looking for new ways to customize the look of my blog. A step-by-step tutorial like yours is precisely what I have been looking for. I am looking forward to your post about adding a navigation bar.

Reply

I didn’t realize that it’s possible to customize the navigation bar. Thanks for the detailed tutorial I will try it for myself

Reply

Thanks for the post.
As you know Adding too many pages to a WordPress blog that has a navigation bar in the header can really make your WordPress blog a mess and this solution is efficient

Reply

Hm, I tried to do this but everything got messed up. Not sure if I made a mistake or if it just doesn’t work with the theme I’m using. I’ll try it again but now I have to figure out how to revert back to the original version of the code…

Reply

website design chester  Replied:

I know it is a bit late but…If you are not 100% sure what you are doing with code it is advisable to make a local backup/copy while you are making changes. If you mess up you can just copy and paste from the unedited copy and this will save any headaches.

All the best.

Reply

Awesome post buddy :) Now I can customize Blog Navigation ;)

Reply

I am a wordpress user and I appreciate you sharing this it really improved my site and manage to learn many thing with your blog articles as well! keep up the good work!

Reply

even though you were very detailed in this article i think i still rather just hire somebody like you to do it for me.

Reply

Oh my gosh! Thank you for the tip about pages. I’ve been going ballistic with making a lot of pages..and well, never thought about using it sparingly. Thank you so much! Will work to make the navi bar better next time.

Reply

This is really good info. I’m not sure if this is common or not because I do not have a lot of experience with that many WP templates but one I just started using has a very easy to use menu option under the appearance which has an option to customize a menu below the hearer and a footer menu. It has made customizing and adding certain things to this site extremely easy. I don’t think all themes have this though so your walk through is very nice. Thanks!

Reply

I’ve been searching the net for this particular code for a long time. Some of my sites were done using the WordPress platform and I’m having a hard time customizing it because of it’s limited features and tools. So glad that WordPress has come up with this latest method in customizing the header navigation bar.This is a great help pal. Continue sharing info like this. Thanks a lot.

Reply

really looks more easier with your code ! thanks !

Reply

Thanks for your help! You definitely pointed me to the right php to edit in the header.php file.

I am really looking for a way to make page navigation that will add an additional specialty page navigation option once a person ventures down a certain category funnel.

Reply

Nice post Jeff, very informative, precise and clear.. Thanx for sharing this post. I am looking for the same since long..

Reply

Hi Jeff,

Thank you for explaining this to us. While the theme I’m using has an easy way of arranging the nav bar, it still helps to know the code mechanism behind this. We really can’t tell when or where the knowledge of such can come handy.

Reply

I’m new to wordpress and it always amazes me to see how much can be done with it. I’ve always been afraid to mess around with code but your posts are very clear. I’ll be bookmarking this post for reference.

Reply

I tried using drupal and I’m so glad i changed to wordpress. it is so much easier to use (my opinion).

I find that having 4-5 menu items in the header works for me and keeps the page very clean.

Enjoy,

Reply

I usually getting trouble with CSS while customize the wordpress header navigation bar, especially if it’s rendered in IE.

Reply

I love wordpress. I just started using it earlier this year (nw to blogging) and I love it.

Reply

very informative post
I followed step by step and ‘well done’
thanks a lot man

Reply

That makes many things possible with wordpress. For example a company website.

Reply

Hi ! I have been wondering how to customize wordpress, as what I’ve seen to some blogs. Thanks for sharing the codes. This is very helpful !

Reply

I just started using has a very easy to use menu option under the appearance which has an option to customize a menu below the hearer. :)

Reply

I have had this very issue in the past. Too many links in the upper link bar made my blog look horrible. Your article gives me clear understanding how to control what pages are shown in the navigation bar. Thanks!

Reply

I’m a big fan of WP for my blog. Changing the navigation bar up has definitely helped.

Reply

THANK YOU! I have subscribed to your RSS feed. It’s really difficult to find instructions for things like this that are written for the regular user! Loving your blog!

Mommy D

Reply

’ve done my fair share of tinkering with the code in a few of my wordpress blogs in order to clean up that Header Nav bar. After all this time and effort I had yet to get one to look the way i wanted it, Until now. I am greatly appreciative for this little guide

Reply

Jeff, thanks for sharing. Something that I have found to be invaluable in doing my WordPress theme edits

Reply

Word Press is ultimate for blogging on the Internet. Nice post Jeff, very informative, precise and clear.

Reply

Hey Jeff, thank you for the code, it worked beautifully without a hitch!

Reply

I usually hardcode the whole template of the wordpress blog, as so far I’ve only used as one area of a bigger website. Obviously being keen to keep the transition as smooth as possible between website and blog. I do use the tags down the right side though, which allows for continual expanding without breaking the design.

Reply

yeah, a CSS is new for me…
i usually play with php…

thanks for sharing…

Reply

Well, I am quite fine in CSS and still doing practicing for PHP. But am sure soon I will be master in both. :)

Reply

Now I learned where I can find the navbar, however I don’t know how to make a fancy navbar. Any help would be appreciated. I have had this very issue in the past. Too many links in the upper link bar made my blog look horrible. Your article gives me clear understanding how to control what pages are shown in the navigation bar. Thanks!

Reply

I have used wordpress for blogging ,but never changed the look and feel of the inbuilt theme.After reading this post, i have the idea to change the look and feel of my blog.So this information is useful for me.

Thanks

Reply

Thank you for the excellent thorough and informative post. This information is timely for me as I’m working on a new blog that will launch in December and I’m going to use what I learned here. Very helpful. I look forwward to your future post.

Reply

Really great work. The code will make it easier and simpler to have a great personalized header navigation bar.

Reply

Awesome!! Thank you so much for this. I placed the external link code you gave into my navigation bar and it worked perfectly. Looking forward to reading more posts from you

Reply

The code was exactly what I was looking for. Thanks Google and thanks to the author.

Reply

wordpress is very good. once you learn to use does not care about anything else. very good this tutorial. I’ll add a navigation bar on my blog

Reply

The codex is great to keep up with the latest WordPress functions and how to use them. The trend in WP themes seems to be towards allowing non-programmers to customize too though, so eventually even things like these might not require any technical knowledge.

Reply

Is the header shown on the website an example of the output produced by the code given?

Reply

Jeff  Replied:

Yes it is.

Reply

That’s the one thing about WordPress, there are some consistencies when it comes to the code, but you have to pay close attention when making changes, because the themes will get you every time!!

Reply

I appreciate this code. The header has always been a source of aggravation for me, and your tip just helped me.

Reply

I have just got into WP blogs and having a fair amount of knowledge in php programming I have found WP easy to customize. I have done some tweaking of fonts and colors for my blogs using standard themes so that it looks and feels somewhat different form most who use these themes.

Reply

WordPress is the platform of choice for not only blogs but websites in general. Marketers such as myself have certainly embraced WordPress.

Reply

Jeff, thanks for the great information. I’ve been looking for straight forward instruction on customizing navigation bar to no avail until I stumbled on your post. This post is by far the best I have found. And with your help I was successful in adding a external link to my website. Thanks.

Reply

I was precisely looking for how to add external links to the top menu. This code is really useful and I hope you will be providing much more information in Future. Now with the WordPress 3.0 launch this thing will get easier. You can create a menu directly from the admin side.

Reply

Excellent article! I’ve done some PHP before, but haven’t touched it in years so this is a nice refresher and guide to show rookies like myself how to edit code

Reply

Thanks for your examples. Im working alot more nowadays with sprited CSS and wordpress themes, but love new/old tricks like this.

Reply

I appreciate this code. The header has always been a source of aggravation for me, and your tip just helped me. WordPress is the platform of choice for not only blogs but websites in general. Marketers such as myself have certainly embraced WordPress.

Reply

I’ve used WordPress a couple of times in setting up a blog, I’m no CSS and php expert but I found it very confusing editing to create your own template from scratch! Editing a bought template helped me out no end…. integrating your tips shouldn’t prove too troublesome however!

Reply

Super information on using wordpress! The code is extremely helpful. Thanks for taking to the time to make this post.

Reply

I signed up for training courses in web design and guess what…? The teacher teach us how to make sites with dreamweaver and TABLES! There’s no trace of CSS at all!

Reply

Thank you for sharing your thoughts Jeff. The code was exactly what I was looking for. I am looking forward to read more posts from you.

Best wishes.

Reply

Exactly what I’ve been looking for. Thanks for breaking this down into understandable chunks…much appreciated!

Reply

I too have purchased a wordpress template and have had problems editing it. Thanks for this post, it should help me out some.

Reply

Thanks for bringing this old article to our attention again. Your step-by-step directions for customizing my header were quite helpful.

Reply

WordPress is magic…. you are magnificent ! Thanks for share Jeff

Reply

i was used WordPress a couple of times in setting up a blog, I’m no php expert but I found it very confusing editing to create your own template from scratch!

Reply

WordPress is the best platform for creating blogs .Thanks for providing with the code. It will be of great help.

Reply

Thanks for the interesting post. But I edited the code to include only the main pages within my header menu:

But it does not work, giving me a syntax error:

Parse error: syntax error, unexpected ‘=’ in /wp-content/themes/greenpoint-milanda/header.php on line 73

Do the code maybe no more work that way with WordPress 3.0.4?

Reply

Hahaha! I found the solution, very simple:

The addition, depth=1, tells the tag to only generate the first level of menu items. All subpages are ignored.

So, problem solved! :)

Reply

FinallyFast.com  Replied:

Hey Andy, I’m actually having a similar problem with my blog. When you say you used depth=1 do you mean in the CSS file? I know there is a depth attribute for positioning in CSS, right?

Reply

Nice article, I must say you gave life to my wordpress blog, as I was bred by classic header navigation.
thanks

Reply

Jeff, you are worth the Nobel Prize of WordPress guidance. Shall I suggest that?

Reply

Wow.. Now, I can give a different and look which I want to my navigation bar. I always hated that tradition navigation bar, now I’m gonna customize it !

Reply

The header has always bothered me, and your tip helped me. WordPress is the platform of choice for not only blogs but sites in general.

Reply

hey jeff ! thanks for sharing the above code for navigation toolbar i have been working with it for a longtime and has made my wordpress theme look good .

Reply

thanks for the additional information jeff

portable solar panels

Reply

A lot of people forget to make a backup of their theme file before they start editing it. Good point and something that can’t be stressed enough. This is something that I’ve stupidly forgot to address also.

Reply

I recently set up my website using wordpress so I would have more control over content. I didn’t realize with simple code manipulation I could have such control over the navigation bar. Great clear and concise post, thanks.

Reply

Thanks i had huge problems with my header!

Reply

I’ve always been afraid to mess around with code but your posts are very clear.. Great post !

Reply

Just started using wordpress, been almost like two months, lot to discover . Thankz for the help really appreciate it , keep up te good work Jeff and best of luck

Reply

I have used this countless times and each time it’s fool proof and I find myself singing your praises for sharing the simple code.

Reply

Thanks for sharing the nice article. I have been looking the google for this info and i wanted to say thanks to you for the post. Also, just off topic, how can i find a copy of this theme? – Regards.
…………….
Nic

Reply

Jeff  Replied:

This is a custom theme based on WP_Premium 1.0.

Reply

Great article Jeff!
Keep up the good work

Reply

WordPress, my web developer friend tells me I need to get on board. I didn’t know where to start, now I do!

Reply

I have recently created an account for WordPress and I know that there are lot’s of things I should learn. Reading this article will help me a lot on customizing my own page to make it unique and looks different from ton’s WordPress user’s.

Reply

Thanx for the code,i tried it and it work. Thanx again

Reply

I tried it and it works,thanx!

Reply

We had this issues with our drop down, too many pages and it was not functional. This is a great solution thanks for the information.

Reply

hey great article.

been trying to customize the word press header for ages

the article helped a lot

thanks

Reply

Been looking for resources on how to customize my header nav bar. Finally found one here. Great help dude. Thanks a lot!

Reply

this post is so old and still usefull. thanks

Reply

Hi Jeff,

good to know how to play around with navigation bar and nice explanation

Reply

you have made it possible to customize the header of a friend’s blog. thanks

Reply

Hello Jeff,

I was searching how did I customize my header navigation bar, then I found your post. I have used it and It is really working. I am very happy. Thanks for sharing this kind of valuable post.

Reply

This documentation is way better than the wordpress official documentation.

You can also edit these inside of wordpress it self using the built in editor. It’s not ideal for power users, but it does let beginners get started as long as they are making simple changes one at a time they should be fine. That way they don’t have to worry about FTPing in and grabbing the file and then editing it.

Reply

Mattress Specialists  Replied:

Hi thought Noah’s comments were really useful, it is best to take it slowly and this encourages beginners, as it can be quite daunting at first. This site does help and gives really easy instructions

Reply

Finally got one to solve my problem. I was looking for such kind of blogs. Thanks

Reply

Thanks for sharing this! Definitely better than other guides on the Internet especially compared to WP documentation. So much more comprehensive and easier to understand.

Reply

Perfect! Thank you for this great resource.
I’ll try to move the whole navbar as an outside php file to include it and this way have the ability to customize only this small file.

Reply

I have a wordpress blog now, but I can’t figure out how to get readers into there! I have been using myspace and it’s been great, subscriptions like crazy, but a lot of them don’t have wordpress…so no leads there. Besides, I am posting the same info to both, so it’s not much of a point of them getting one. How can I increase my wordpress readership? I already utilize tags, but I still only got about 89 views in two weeks.

Reply

I have a wordpress blog now, but I can’t figure out how to get readers into there! I have been using myspace and it’s been great, subscriptions like crazy, but a lot of them don’t have wordpress…so no leads there. Besides, I am posting the same info to both, so it’s not much of a point of them getting one. How can I increase my wordpress readership? I already utilize tags, but I still only got about 89 views in two weeks.

Reply

I hadn’t been able to find the include and exclude codes on my Dream weaver theme. Guess i just publish the pages privately. Thanks a lot for this post anyway.

Reply

I always end up beeing tired of cooding myself – thanks to wordpress its popularity, i always find a piece of code that helps allows me solving my problems

Reply

Man, you are a lifesaver. I have looking for something like this for a while. Thanks.

Reply

I’m going to try this code right now as i’ve been looking for a working one for a while. Thanks for sharing this valuable info.

Reply

I’m using Weaver 2010 right now for my new work-at-home site. Your post has been really helpful to me. Thanks. I’m definitely a WordPress newbie. :)

Reply

I’ve tried this tips and works on me.

Reply

I use the WordPress 3.0 menu management system now. Much more powerful and easier to manage.

Reply

Leave a comment
Drive-By comments will be deleted! Like "Thanks for sharing", "Nice post", or any other text that doesn't contribute to the discussion. If you ask a very specific question about your particular WordPress theme, it will probably be deleted. I can fix your WordPress site but for a price. If you ask a question like "Why don't my blog work right", it will be deleted. If you ask a question about your WordPress site without a leaving a link to it, it will be deleted. The point is to ask questions and or comment on the the actual content of the post, and to please use some common sense. All comments are moderated and will appear when approved. Thank you.

(required)

(required)