-
-
Save GaryJones/1799174 to your computer and use it in GitHub Desktop.
Revisions
-
GaryJones renamed this gist
Feb 11, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
GaryJones revised this gist
Feb 11, 2012 . 1 changed file with 18 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,15 +2,25 @@ add_filter( 'genesis_nav_items', 'sws_social_icons', 10, 2 ); add_filter( 'wp_nav_menu_items', 'sws_social_icons', 10, 2 ); /** * Adds a widget area before primary menu items. * * @author Bill Erickson * @author Gary Jones * @link https://gist.github.com/gists/1799174 * * @param string $menu Existing menu items markup. * @param array $args Menu arguments. * * @return string Amended menu items markup. */ function sws_social_icons( $menu, array $args ) { if ( 'primary' !== $args['theme_location'] ) return $menu; ob_start(); dynamic_sidebar( 'social-menu' ); return ob_get_clean() . $menu; } -
billerickson renamed this gist
Feb 11, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,9 @@ function sws_social_icons($menu, $args) { $args = (array)$args; if ( 'primary' !== $args['theme_location'] ) return $menu; ob_start(); dynamic_sidebar('Social Menu'); $social = ob_get_clean(); return $social . $menu; } -
There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <?php add_filter( 'genesis_nav_items', 'sws_social_icons', 10, 2 ); add_filter( 'wp_nav_menu_items', 'sws_social_icons', 10, 2 ); function sws_social_icons($menu, $args) { $args = (array)$args; if ( 'primary' !== $args['theme_location'] ) return $menu; $social = dynamic_sidebar('Social Menu'); return $social . $menu; } ?>