How to Put a Static Link in a WordPress Header

August 12 3 Comments Category: wordpress

I’m pretty much sold on WordPress as a solid Content Management System. I used to be partial to Drupal. But WordPress is so much easier to use and it can be adapted to do most of what Drupal does. Though, if I’m building a more robust site, such as Global Citizen Wiki, I’m sticking with Drupal. But for blogs and basic websites, WordPress works great.

One problem I ran into, though, was adding a link to a static page that wasn’t part of WordPress in the WordPress Header. No matter how many settings menus I went though, I just could not find a way to put a static link in the WordPress Header.

I did some searching around and discovered a simple workaround. This static link header workaround WordPress requires you to edit your theme manually, which you can do within WordPress with the Theme Editor.

Go to Theme Editor and find the WordPress header.php file and open it. All you have to do is find this code (it should look something like this):

exampl1.jpg

Once you’ve found the code, after the ‘php wp_list_pages’ tag tap enter and then code an HTML link, just like you would normally. Make sure it’s before the close of the UL tag. This is an example of what it looked like when I was done.

example2.jpg

Keep in mind that, any links you add will always appear after the links generated by WordPress. Also, you will have to do this again if you decide to switch WordPress Themes. Your theme code may be different but the principle is the same, find the coded list which is used to generate the header links and manually add an HTML link.

For an example of how this looks when done, check out my blog Anglotopia and look at the header.

Happy Blogging!

3 Responses

Write a comment
  1. thanks for the tips and for such interesting resource!
    I’ve also been looking for ways to convert this tips into my site.

    forextrading 31 March 2009 at 9:34 am Permalink
  2. Hi admin…some good advice on how to edit the source code for a static page. I tend to stay away from messing with the editor because I don’t have a clue about what I’m looking at, and I’m afraid I’ll mess everything up. I do have another question though. I have an independent website, besides my WP ones, and would like to integrate WP into it. How do I do that?

    Sonia 16 July 2009 at 1:55 pm Permalink
  3. Thank you, does Drupal have any module or plugin to handle blogs? Also, I have been reading that it is very complex and does require at least some programming skills, is that really so?

    thx

    marco

    marco 23 August 2009 at 4:26 pm Permalink

Write a Comment

Commenter Gravatar