Home link in wp_ nav_ menu() (5 posts)

  1. cinematic
    Posted 5 years ago #

    Hi, I am trying to figure out how to put a home link at the beginning of wp_nav_menu().

    If I include the function in my theme no home link is added (in opposite to the twentyten theme). I can't add a li-tag as I usually did in earlier themes because wp_nav_menu() had it's own wrapper.

    How is the home link included in twentyten?

    Thanks for any help!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 5 years ago #

    well, if you are making a custom menu, just make a link called home set to your url.... you just make one in the menu creator

    if you are using the default page list and you don't have a home link,

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

    added to functions.php will insert a home link

  3. cinematic
    Posted 5 years ago #

    Thank you very much for your helpful info! Works like a charme ... :)

  4. oneway
    Posted 4 years ago #

    How do I do this in another theme please?

  5. oneway
    Posted 4 years ago #

    What .php file does this code go in please?

Topic Closed

This topic has been closed to new replies.

About this Topic