Forum Replies Created
-
AuthorPosts
-
cambrosiMember
Thanks, Brad.
cambrosiMemberThanks for your help. I ended modifying the rss case in this function in menu.php, and then tweaking the styles:
function genesis_nav_right( $menu, stdClass $args ) { if ( ! genesis_get_option( 'nav_extras' ) || 'primary' !== $args->theme_location ) return $menu; switch ( genesis_get_option( 'nav_extras' ) ) { case 'rss': $rss = '<a rel="nofollow" href="' . get_bloginfo( 'rss2_url' ) . '"></a>'; $menu .= '<li class="right rss">' . $rss . '</li>'; break; case 'search': // I hate output buffering, but I have no choice ob_start(); get_search_form(); $search = ob_get_clean(); $menu .= '<li class="right search">' . $search . '</li>'; break; case 'twitter': $menu .= sprintf( '<li class="right twitter"><a href="%s">%s</a></li>', esc_url( 'http://twitter.com/' . genesis_get_option( 'nav_extras_twitter_id' ) ), esc_html( genesis_get_option( 'nav_extras_twitter_text' ) ) ); break; case 'date': $menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '</li>'; break; } return $menu; }
cambrosiMemberThanks, Brad. I tried adding this code and I took out the site. Does it go under the
require_once( dirname( __FILE__ ) . '/lib/init.php' );
in functions.php?add_filter( 'wp_nav_menu_items', 'custom_nav_item', 10, 2 );
/**
* Callback for Genesis 'wp_nav_menu_items' filter.
*
* Add custom right nav item to Genesis primary menu.
*
* @package Genesis
* @category Nav Menu
* @author Ryan Meier http://www.rfmeier.net
*
* @param string $menu The menu html
* @param stdClass $args the current menu args
* @return string $menu The menu html
*/function custom_nav_item( $menu, stdClass $args ){
// make sure we are in the primary menuif ( 'primary' != $args->theme_location )
return $menu;// see if a nav extra was already specified with Theme options
if( genesis_get_option( 'nav_extras' ) )
return $menu;// additional checks?
// append your custom code
$menu .= sprintf( '<div id="nav">%2$s%1$s%3$s</div>', $nav, genesis_structural_wrap( 'nav', '<div class="rss"></div><div class="wrap">', 0 ), genesis_structural_wrap( 'nav', '</div><!-- end .wrap -->', 0 ) );
// return the menu
return $menu;
} -
AuthorPosts