Skip to content

Instantly share code, notes, and snippets.

/gist:1519641
Created Dec 25, 2011

Embed
What would you like to do?
Add Description to Subnav
<?php
/**
* Add Description to Subnav
* @author Bill Erickson
* @link http://www.billerickson.net/customizing-wordpress-menus/
*
* @param string $subnav_output
* @param string $subnav
* @param array $args
* @return string
*/
function be_subnav_with_description( $subnav_output, $subnav, $args ) {
// Add Walker to the subnav arguments
$walker = new Menu_With_Description;
$args['walker'] = $walker;
// Build the subnav
$subnav = genesis_nav( $args );
$subnav_output = sprintf( '<div id="subnav">%2$s%1$s%3$s</div>', $subnav, genesis_structural_wrap( 'subnav', 'open', 0 ), genesis_structural_wrap( 'subnav', 'close', 0 ) );
// Return subnav
return $subnav_output;
}
add_filter( 'genesis_do_subnav', 'be_subnav_with_description', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.