• Resolved rasins

    (@rasins)


    I’m having trouble with my twenty eleven child theme menu. I’ve put in my own menu using images, but I’m having some issues.

    I’ve managed to put each of my menu images into classes wordpress generates, however the ‘home’ menu I’ve put in #menu li. This is obviously wrong, but I can’t see where else it needs to go. All my other menu items generate something like this #access li.page_item.page-item-200, but there doesn’t seem to be anything like that for my ‘home’ item. Any ideas?

    http://lyndamiller.co.uk/

    Many thanks in advance,
    AMA

    http://wordpress.org/extend/themes/twentyeleven/

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    (@esmi)

    Try using Firefox with the Firebug add-on for this kind of CSS work.
    http://getfirebug.com/

    Thread Starter rasins

    (@rasins)

    I have been using Chrome and the inspect element within the browser. There doesn’t seem to be a class for the home menu item and I don’t understand why. there are classes for all the other menu items in my menu.

    Check out the html. See, no class.

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    Thread Starter rasins

    (@rasins)

    Is it because I have the homepage set up as a static page do you think?

    Thread Starter rasins

    (@rasins)

    After much digging this seems to be an issue within my template. When I add a custom menu it’s meant to auto generate a class for each li in the menu which it does, except for the first li. Can someone point me in the right direction of what I need to add in functions to my menu in order to get this working please.

    Many Thanks

    When I add a custom menu

    The home menu item is set in functions.php so you can remove the menu item by removing the filter and then use a URL menu item to point to the home page.

    From Twenty Eleven functions.php

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

    Assuming you using the custom menu css-classes?

    If so then in the child themes function.php

    /** START function will remove the parent filter  */
    add_action( 'after_setup_theme', 'child_remove_filters' );
    if ( !function_exists( 'child_remove_filters' ) ):
    function child_remove_filters() {
    	remove_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
    }
    endif;
    /** END function will remove the parent filter  */

    Now create a URL menu item with a link to the home page, and add the Menu Item css-class

    HTH

    David

    Thread Starter rasins

    (@rasins)

    Thank you David. You are a star! I was indeed missing the bit for my child themes function.php. This has done the job. Many many many thanks. 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Theme: Twenty Eleven] Menu issue with twenty eleven child theme’ is closed to new replies.