adding links to the top menu / header navigation

Whether you are using the default header or the top navigation (for those who have replaced the standard header with a custom header graphic and activated the top menu), adding links to either the header (in button style) or the top navigation (normal text link style) is the same procedure:

1. Adding links to the header navigation:
Open the header template (header.php) in your editor and find this code:

<div id="headernav">
<ul>
<li><a href="<?php bloginfo('url'); ?>">Home</a></li>
<!- - <li><a href="URL">Link2</a></li> - ->
<!- - <li><a href="URL">Link3</a></li> - ->
<?php
// wp_list_pages(’title_li=&depth=3&sort_column=menu_order’);
// wp_list_categories(’title_li=&depth=3′);
?>
</ul>
</div>

As you can see, the links are simply list items of an unordered list. I have already added two more list items that are commented out, so you only need to remove the HTML comments before ( <!- - ) and behind ( - -> ) the list items and replace “URL” with the target URL for the link and “Link2″ / “Link3″ with the anchor text for the link.
If you need more links, simply add more list items in the same style.

You can also use categories or pages as links inside the header. To add either your WP pages or your blog categories to the header, simply remove the PHP comment ( // ) before the corresponding line in the code above, i.e.:
wp_list_pages… for pages
wp_list_categories … for categories

Caveat: Because of the drop-down menus, the links inside header / top navigation should not exceed one line or the drop-down menu won´t work.

2. Adding links to the top menu:
Open the top menu template (topmenu.php) in your editor and find this code:

<div id="topmenu">
<ul>
<li ><a href="<?php bloginfo('url'); ?>">Home</a></li>
<!- - <li><a href="URL">Link2</a></li> - ->
<!- - <li><a href="URL">Link3</a></li> - ->
<?php
// wp_list_pages(’title_li=&depth=3&sort_column=menu_order’);
// wp_list_categories(’title_li=&depth=3′);
?>
</ul>
</div>

Proceed in the same way as explained above (see 1.)

Social Bookmarks: - (what´s this?) - spread the word!

Stumble Delicious Technorati Digg Reddit socialmarker(more bookmarking services)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

If you want to leave a feedback to this post or to some other user´s comment, simply fill out the form below.