Created
December 25, 2011 19:27
-
-
Save anonymous/1519641 to your computer and use it in GitHub Desktop.
Add Description to Subnav
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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