Skip to content

Instantly share code, notes, and snippets.

Created December 25, 2011 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/1519641 to your computer and use it in GitHub Desktop.
Save anonymous/1519641 to your computer and use it in GitHub Desktop.
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