Support » Fixing WordPress » Add 'Home' to menu across top of site??

  • Resolved alessandro74

    (@alessandro74)


    Hi folks,
    Does anyone know how I can get a link at the top of the site to show ‘Home’ and link to the homepage of a blog?
    I am using the BirdSite theme.

    You can see it shows my ‘Pages’ across the top, but not ‘Home’
    Screenshot

    I would like a ‘Home’ link on the left of the top menu.
    I have tried to add it, but can only add new pages and not a link to just root of the blog.
    Thanks for any advice
    Alex

Viewing 14 replies - 1 through 14 (of 14 total)
  • Q8Treacle

    (@q8treacle)

    Im new to all this, but the way I done it was to make a new page, called it home, went to settings, reading, and made the page I called home a “static” page.. Worked a treat

    You would need to look in your header.php file in your theme first and determine if your theme uses wp_list_pages or wp_nav_menu to display the menu?

    Q8Treacle

    (@q8treacle)

    LMAOOO

    Voodoo, Seems that I am in debt by one bar of chocolate, I thought I had that part down!!

    Yeah…to get the home link, there are options depending on how the menu is called

    wp_list_pages would require a link to home to be coded in

    wp_nav_menu you would use the menu creator in WP to make a link named home with your main url, or add

    // Filter wp_nav_menu() to add additional links and other output
    function new_nav_menu_items($items) {
    	$homelink = '<li class="home"><a href="' . home_url( '/' ) . '">' . __('Home') . '</a></li>';
    	$items = $homelink . $items;
    	return $items;
    }
    add_filter( 'wp_nav_menu_items', 'new_nav_menu_items' );

    to functions.php

    If your theme uses wp_nav_menu, but you don’t make a menu, then it falls back to wp_page_menu

    in this case adding:

    function mybirdsite_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'mybirdsite_page_menu_args' );

    to your functions.php should get you the home link

    Thread Starter alessandro74

    (@alessandro74)

    Hey – thanks, my theme uses wp_nav_menu.
    How can I edit that to include a new ‘Home’ menu item?

    I did a quick search, but found an option a little too complicated??!

    thanks in advance
    Alex

    Moderator t-p

    (@t-p)

    Also, 3.0 includes an easy to use mechanism for introducing customized navigation menus into your theme.

    Which means you can add “home” via:
    Dashboard – Appearance -Menues.

    Find out if your theme allows custom menus.

    http://codex.wordpress.org/Navigation_Menus

    I looked at your theme and it does use wp_nav_menu

    have you created a custom menu using the method @t-p suggested?

    If so, you can just add a home link

    If not, and you don’t plan to, then try my last block of code in the above post

    Thread Starter alessandro74

    (@alessandro74)

    Hi! Thanks – yes, I did use your code to add it!
    However, seems it keeps the ‘underline’ on the home link, even when not in a mouse-over event is happening.

    But it only shows the underline permanently when I on the Home page itself.
    if I am on other pages, the mouse-over works as expected (ie. only appears to underline when the mouse is over the link)

    When on the home page, though, the underline is always visible.

    Thanks
    Alex

    when you visit other pages on your site, are they underlined?

    function mybirdsite_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'mybirdsite_page_menu_args' );

    this just adds the tab, nothing else. I’m going to have to guess that your css has the underline added for the active tab.

    Yup…its a function of your theme

    #header ul li.current_page_item > a {
    	text-decoration: underline;
    	}

    in style.css is what does it

    Thread Starter alessandro74

    (@alessandro74)

    @rev.Voodoo
    Yes – indeed they are! I should have seen that. I guess that’s fine then. I will look at the css and try to remove it from active tab. it’s because I have the HR right underneath the text, it looks a little ‘tight’ on the home page.

    Thread Starter alessandro74

    (@alessandro74)

    @rev.Voodoo
    Legend. Simply, you’re a legend.
    thanks. I found some of ‘text-decoration’ and changed, but it didn’t work – but I wasn’t on the ‘current_page_item ! DOH!
    Thanks again
    Alex

    glad we could get everything going for ya!!!

    I found this article that is so easy and works!

    How to Show Home Page Link in WordPress 3.0 Menu

    Hope it helps!

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Add 'Home' to menu across top of site??’ is closed to new replies.