Community Forums › Forums › Archived Forums › General Discussion › Update to Genesis 2.1.0 broke style for secondary nav bar
Tagged: Genesis 2.1.0
- This topic has 26 replies, 16 voices, and was last updated 9 years, 9 months ago by Andrea Rennick.
-
AuthorPosts
-
June 30, 2014 at 11:44 am #112124jimpepeMember
I rolled back to 2.0.2 to fix the problem, but is there a workaround or adjustment I need to make to my child theme's style sheet?
June 30, 2014 at 2:18 pm #112166klutchtechParticipantI'm having the same problem with the Corporate Theme. The upgrade to Genesis 2.1.0 broke the styling for the Secondary Menu, specifically because it is now using <div id="nav"></div> to wrap the Primary and Secondary Menu. Previously the Primary Menu was wrapped in <div id="nav"></div> and the Secondary Menu was wrapped in <div id="subnav"></div>.
You can check out my site at http://ktsandbox.com and see how the Primary and Secondary Menu bars are now styled identically because if this problem.
They should be styled like the Corporate Theme demo: http://demo.studiopress.com/corporate/. In the demo, the Primary Menu is black and the Secondary menu is grey.
Anyone have a fix for this yet?
Thanks!
June 30, 2014 at 3:08 pm #112193meta13MemberSame here.
Looks like
<div id="subnav">
changed to<div id="nav">
.There are now two
<div id="nav">
's if you are using both the main nav and subnav.Is this a bug or did something change that we should know about with 2.1?
June 30, 2014 at 3:20 pm #112200digitalnordicMemberSame with Backcountry Theme.
June 30, 2014 at 3:33 pm #112205sylviabassMemberHi, noticed the same thing with Prose. Both menus are now using "nav" as the ID, so I'm unable to style the submenu using Genesis > Design Settings. Reverted back to 2.02 for now until there is a fix.
June 30, 2014 at 4:19 pm #112216Gary JonesMemberJune 30, 2014 at 4:19 pm #112217nutsandboltsMemberHi guys,
Just wanted to let you know that the dev team is aware of the issue and looking into it. This only seems to be affecting pre-HTML5 themes as far we know. I'll keep you posted if I hear any updates!
Edited to add: And I see Gary beat me to it. 🙂
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+June 30, 2014 at 4:31 pm #112221klutchtechParticipantThank you Gary and Andrea!
June 30, 2014 at 4:40 pm #112231Gary JonesMemberFound the problem - it's my fault.
With that out of the way, here's a working fix.
Open up Genesis 2.1 files, specifically lib/functions/menu.php
Go down to line 72.
Replace the whole of the function (line 72 start "function genesis_get_nav_args(...." and ending on line 142 which just has the closing brace "}") with the following:
function genesis_get_nav_menu( $args = array() ) { $args = wp_parse_args( $args, array( 'theme_location' => '', 'container' => '', 'menu_class' => 'menu genesis-nav-menu', 'echo' => 0, ) ); //* If a menu is not assigned to theme location, abort if ( ! has_nav_menu( $args['theme_location'] ) ) { return; } $sanitized_location = sanitize_key( $args['theme_location'] ); $nav = wp_nav_menu( $args ); //* Do nothing if there is nothing to show if ( ! $nav ) { return; } $xhtml_id = $args['theme_location']; if ( 'primary' === $args['theme_location'] ) { $xhtml_id = 'nav'; } elseif ( 'secondary' === $args['theme_location'] ) { $xhtml_id = 'subnav'; } $nav_markup_open = genesis_markup( array( 'html5' => '<nav %s>', 'xhtml' => '<div id="' . $xhtml_id . '">', 'context' => 'nav-' . $sanitized_location, 'echo' => false, ) ); $nav_markup_open .= genesis_structural_wrap( 'menu-' . $sanitized_location, 'open', 0 ); $nav_markup_close = genesis_structural_wrap( 'menu-' . $sanitized_location, 'close', 0 ); $nav_markup_close .= genesis_html5() ? '</nav>' : '</div>'; $nav_output = $nav_markup_open . $nav . $nav_markup_close; $filter_location = 'genesis_' . $sanitized_location . '_nav'; //* Handle back-compat for primary and secondary nav filters. if ( 'primary' === $args['theme_location'] ) { $filter_location = 'genesis_do_nav'; } elseif ( 'secondary' === $args['theme_location'] ) { $filter_location = 'genesis_do_subnav'; } /** * Filter the navigation markup. * * @since 2.1.0 * * @param string $nav_output Opening container markup, nav, closing container markup. * @param string $nav Navigation list (<code><ul></code>). * @param array $args { * Arguments for <code>wp_nav_menu()</code>. * * @type string $theme_location Menu location ID. * @type string $container Container markup. * @type string $menu_class Class(es) applied to the <code><ul></code>. * @type bool $echo 0 to indicate <code>wp_nav_menu()</code> should return not echo. * } */ return apply_filters( $filter_location, $nav_output, $nav, $args ); }
That gets rid of the hard-coded nav and allows it to be subnav dealing with the secondary menu.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
June 30, 2014 at 4:55 pm #112236John ChadwickMemberHi Gary and Andrea!
I am creating a bunch of niche blogs for other users and before I go live with them I would like to know if this issue is going to be fixed as a new release? All the niche blogs use the pre HTML5 Lifestyle theme. I can't release them knowing that a potential owner will have to go into the core code and edit it. I guess I could edit one of the installs and then clone it but could the next Genesis update knock out the secondary nav again? Thanks for your hard work on the new update........love Genesis!
Kind regards,
John
June 30, 2014 at 5:22 pm #112244Gary JonesMemberThe next release of Genesis will have this fixed. I've posted a solution for Nathan, so it's up to him to accept it, improve it if necessary, and when to do a new release. But I know he won't let another release go out without this being fixed.
Andrea has confirmed my code is working, so if you're happy to do the fix yourself, then go for it.
If you can wait a day or two (I would hope Genesis 2.1.1 is out tomorrow, since we currently have broken the appearance of secondary menus on all XHTML themes that were using the ID as a styling hook), then that would be my current recommendation.
(Usual disclaimer - I don't work for Copyblogger, so I don't officially represent them or their views)
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
June 30, 2014 at 5:25 pm #112246klutchtechParticipantThat worked! Our live site http://www.Stranaska.com is displaying the Secondary Menu correctly now. Thank you for looking in to this so quickly!
~ Kelli
June 30, 2014 at 5:34 pm #112249Gary JonesMemberGlad to hear it's working for you as well klutchtech
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
June 30, 2014 at 8:02 pm #112289DawnMemberI'm having this same issue with Blissful, but this coding fix isn't working for me. Any ideas?
http;//www.homemakinghacks.com
Thanks!
July 1, 2014 at 2:11 am #112342Gary JonesMemberDid you clear your hosts cache etc Dawn?
If you want to send me with some FTP login details (server, port, username, password), then I can see if I can get it working for you. https://gamajo.com/contact
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
July 1, 2014 at 3:18 am #112350AntonyMemberHi,
same problem with Enterprise child theme after upgrading to Genesis 2.1.0: backgroung of submenu now has the same color and shape of primary menu.
I can send you a screenshot if you want.
Thanks for your support.
CorradoJuly 1, 2014 at 6:36 am #112388DawnMemberHi Gary,
Yes, I did. Thanks for your help, I sent over my info to you.
July 1, 2014 at 8:14 am #112426ScoutHarperMemberSame here. I use Pretty Young Thing and the styling for my secondary navigation bar is gone. For a relatively untechy type like me, where are the files I need to change?
Thanks so much,
ScoutHarperJuly 1, 2014 at 8:26 am #112432Gary JonesMemberIf you're untechy, I'd say to wait until 2.1.1 is out (hopefully, today), which will fix this for you.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
July 1, 2014 at 8:34 am #112433ScoutHarperMemberOkay. Will do.
Thanks. Gary. -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.