Manually add a link in a WP header menu?

Discussion in 'WordPress' started by Pixelrage, Mar 23, 2009.

  1. #1
    I'm looking to manually add a link in the top main menu bar of my Wordpress site. It's within a UL tag. I could never figure out how to do this...here's the code that calls the "Home" page and all categories to appear in the main menu. All I want to do is manually add one more link in there, that points to a specific URL:

    	<div id="categories">
    		<div class="container">
    			<ul id="category-list" class="clearfix">
    				<li<?php if(is_home()): ?> class="current-cat"<?php endif; ?>><a href="<?php bloginfo('url'); ?>">Home</a></li>
    
    [B]<!-- THIS IS WHERE I WANT TO PUT A LINK -->[/B]
    
    				<?php wp_list_categories('title_li='); ?>
    
    			</ul>
    		</div>
    	</div>
    Code (markup):
    As you may have imagined, if I simply put a regular link in there, it does not "take" the formatting of the CSS UL formatting (it just appears in default font, un-aligned).

    Please help out with this if you know - will definitely give rep for your help!
     
    Pixelrage, Mar 23, 2009 IP
  2. hmansfield

    hmansfield Guest

    Messages:
    7,904
    Likes Received:
    298
    Best Answers:
    0
    Trophy Points:
    280
    #2
    This is how I did it:
    
    <li class="first"><a  href="http://www.[I]whateveritis.com[/I]/"title="Some Kind of Text">Name of the Link</a></li>
    Code (markup):
     
    hmansfield, Mar 23, 2009 IP
    Pixelrage likes this.
  3. bojomojo

    bojomojo Peon

    Messages:
    921
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Find out the class your list uses, by viewing the source of the displayed page.
    then
    
    <li class="classhere"><a href="http://www.link.com" target="_parent">Link Name</a>
    
    Code (markup):
     
    bojomojo, Mar 24, 2009 IP
    Pixelrage likes this.
  4. Pixelrage

    Pixelrage Peon

    Messages:
    5,083
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    0
    #4
    THANKS!!! I had a feeling it would be something stupid and simple, like that "class=" deal. :)
     
    Pixelrage, Mar 24, 2009 IP