Forum Replies Created
-
AuthorPosts
-
Gary JonesMember
Fredtoft - thanks for posting 🙂
What should the exact category and tags be for the first post on the first link?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
June 30, 2014 at 5:34 pm in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #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 5:22 pm in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #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
Gary JonesMemberIs that a custom theme?
Is it based on a StudioPress theme?
Does it include some customisations that involve markup and attributes?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
June 30, 2014 at 4:40 pm in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #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:19 pm in reply to: Update to Genesis 2.1.0 broke style for secondary nav bar #112216Gary JonesMemberGary JonesMemberGary JonesMemberMy apologies to all - I'd missed (it's nearly 3am here) that it was the widget title that wanted to be split up, not the site title.
The tutorial I linked to won't obviously be suitable either.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMember"leave the title blank" presumably means setting Settings->General site name to an empty string. That affects
<title>
elements, site heading (the H1 would be "<h1></h1>") and other bits, and really isn't advised.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberUnfortunately, that will hinder SEO, since the H1 wrapping the site-title would be lost.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberYou should be able to adapt this tutorial, so instead of adding a span in, you add your title with a <br /> element instead:
http://www.carriedils.com/custom-site-title-genesis/
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberYes $wp_query->current_post can be used in either case, but some folks still use (old XHTML theme) code that relies on $loop_counter, so Genesis keeps it incrementing for backwards compatibility. For forward compatibility (new code, HTML5 mode), it can be dropped, since WP already provides that value.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberAs you're using HTML5, the $loop_counter isn't incremented by Genesis (it's a Genesis global variable, not WP).
The reason it wasn't implemented in HTML5 mode, is that WP already has it's own counter which does exactly the same thing.
Try:
function sf_post_class($classes) { global $wp_query; $classes[] = 'one-fourth'; if ($wp_query->current_post % 4 == 0) { $classes[] .= 'first '; } return $classes; }
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberDo you have that Append Site Description (tagline) ... checkbox checked?
Have you saved the SEO settings page?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberWhat version of Genesis are you running?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberFind
genesis_home()
somewhere in your theme, and change it to
do_action( "genesis_home" );
instead.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberIt's not a snippet that's needed.
Can you share a screenshot showing your Genesis -> SEO Settings -> Homepage settings?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberTagline is the Site Description. If you fill that in, then the <title> on the home page will be populated correctly. You might need to remove or hide it from appearing in your header (which is why you might have deleted it from the settings in the first place), but that can be fixed afterwards - Susan can tell you how 🙂
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberJust take all the remove_action()'s from a landing page template, add it to attachment.php and then tweak from there. Really, no plugin necessary.
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
Gary JonesMemberIs your Site Description (WP -> Settings -> General) empty?
WordPress Engineer, and key contributor the Genesis Framework | @GaryJ
-
AuthorPosts