Support » Fixing WordPress » Placed a TwentyTen nav bar in a Kubrick theme, custom menus disappear

  • I placed the code for a TwentyTen navigation bar in a Kubrick-based theme, and it works fine, but… when I choose to create a custom menu from the dashboard, the nav bar disappears.

    The nav bar works fine with the existing page hierarchy set up by setting order numbers in the pages dashboard, and using parent and child pages.

    I made sure I had the dashboard menus functions copied over from TwentyTen’s function.php page, so that allowed the menu functions to appear in the dashboard of my Kubrick-based theme, but when I chose to activate a custom menu setup I made….. poof, the nav bars disappear.

    Any idea what I need to do? I looked in the TwentyTen functions page for more functions but I’m not seeing them.

Viewing 15 replies - 1 through 15 (of 31 total)
  • You copied everything over from the header.php too?

    Yes, I copied this

    <div id="access" role="navigation">
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    		</div>

    from TwentyTen’s header.php and put in my theme’s header.php

    esmi

    (@esmi)

    Forum Moderator

    That’s not everything from header.php…

    Oh, I see this addtional bit of code

    <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>

    that I stripped out because it was “Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff”

    Is that critical to the nav bar?

    Okay, I put the full “access” code from TwentyTen’s header.php into my theme’s header.php and now I get “Skip to content” in the nav bar in a top row, then the pages listed in the second row. I choose my custom menu, and the second row disappears. All I’m left with is the “skip to content” to the left in the nav bar.

    well, you need to bring over all the related css as well, if you are bringing in twentyten’s menu setup

    The css hides that skip to content business, which is for screen readers and meant to be hidden’

    It also controls dropdown behaviour, etc

    Ah, I’ll look through the TwentyTen CSS and see what I missed. I did pick up the whole “menu” section of the CSS but obviously there’s a few other “access” areas I need to pick up.

    Okay I found a @media print tag in the CSS, and I found a Mobile Safari item, too which had “access” as the div. I added those related sections to the CSS of my Kubrick-based theme, but I”m still getting the “Skip to content” info in the nav bar.

    Any ideas? Thanks for your time RevVooDoo.

    /* Text meant only for screen readers */
    .screen-reader-text {
    	position: absolute;
    	left: -9000px;
    }

    you get this guy? from just above the header section

    Okay, that bit of code got rid of the “skip to content” message, but I’m still left without a custom menu listing. The nav bar dissapears. Again, if I use none as a custom menu, I get the default page order in the nav menus. But choosing a custom menu makes the nav bar disappear.

    In the TwentyTen CSS, here are two sets of code I didn’t copy over that relate to the “access” div (and these are shortened examples to only show what’s relevant to “access”:

    /* =Mobile Safari ( iPad, iPhone and iPod Touch )
    -------------------------------------------------------------- */
    ......
    
    #access,
    .entry-meta,
    .entry-utility,
    .navigation,
    .widget-area {
    	-webkit-text-size-adjust: 120%;
    
    }

    and

    /* =Print Style
    -------------------------------------------------------------- */
    
    @media print {
    	....
    	#access,
    	#branding img,
    	#respond,
    	.comment-edit-link,
    	.edit-link,
    	.navigation,
    	.page-link,
    	.widget-area {
    		display: none !important;
    	}
    
    }

    Are these critical to making the custom menus work? I pasted these relevant parts in and the page structure got messed up.

    Nope, that is pretty self explanatory….styling for mobile browsers, and for print

    So, you have this business from header.php:

    <div id="access" role="navigation">
    			  <?php /*  Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff */ ?>
    				<div class="skip-link screen-reader-text"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentyten' ); ?>"><?php _e( 'Skip to content', 'twentyten' ); ?></a></div>
    				<?php /* Our navigation menu.  If one isn't filled out, wp_nav_menu falls back to wp_page_menu.  The menu assiged to the primary position is the one used.  If none is assigned, the menu with the lowest ID is used.  */ ?>
    				<?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    			</div><!-- #access -->

    and you register the menu in functions.php

    // This theme uses wp_nav_menu() in one location.
    	register_nav_menus( array(
    		'primary' => __( 'Primary Navigation', 'twentyten' ),
    	) );

    and I’m pretty confident we have the css right, so now we create our custom menu in the menu editor, and then we assign our new custom menu to the Primary position

    Is that all correct? If so…. it really should be working

    Well it’s still not working for some reason, and I copied your two bits of code there just to make sure.

    Do you have any plugins going or anything? I would test without any plugins active….

    Something is causing a conflict now, gotta try to pin that down.

    I turned off all plugins, and the problem persists. So it’s not a plug-in issue, apparently.

    esmi

    (@esmi)

    Forum Moderator

    Have you added support for custom menus in functions.php?

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘Placed a TwentyTen nav bar in a Kubrick theme, custom menus disappear’ is closed to new replies.