• Resolved PeterWadson

    (@peterwadson)


    Hey guys,

    I’ve got my main menu in header.php:

    <?php wp_nav_menu(array(
    				'container' 		=> 'div',
    				'container_class'	=> '',
    				'container_id' 		=> 'menu',
    				'items_wrap' 		=> '<ul><li><a href="'.get_bloginfo('url').'">Home</a></li>%3$s</ul>',
    				'theme_location'	=> 'mainmenu'
    			)); ?>

    I’ve allready registered it in the functions.php and
    don’t overwrite the menu with a special menu.
    But it only gives me a confusing menu with the only page i have and not with the home button I expect.

    What’s wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Is this when you are using a custom menu or when you are using the fallback menu generated by wp_page_menu()?

    Thread Starter PeterWadson

    (@peterwadson)

    Okay maybe i should wirte what I want ^^

    I want to have menu which starts with the “home” button and after that lists the pages or maybe the categories (don’t know right now). But I also want it to be “modify-able” so that the user can overwrite it with a customised one.

    Thanks!

    wp_nav_menu is definitely the way to go then. You can configure the default fallback (wp_page_menu) to automatically show a Home item by using something like:

    // Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
    function my_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'my_page_menu_args' );

    in your theme’s functions.php file.

    Thread Starter PeterWadson

    (@peterwadson)

    Yep thats works perfectly! Thanks alot 🙂

    Pete

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Menu] can't add parameters’ is closed to new replies.