Last active
March 3, 2017 11:14
-
-
Save billerickson/1326009 to your computer and use it in GitHub Desktop.
Add Extra Code to Any Menu
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 Extra Code to Any Menu | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/customizing-wordpress-menus/ | |
* | |
* @param string $menu | |
* @param object $args | |
* @return string modified menu | |
*/ | |
function be_menu_extras($menu, $args) { | |
if( 'secondary' !== $args->theme_location ) | |
return $menu; | |
return $menu . '<li class="right">Your extras go here</li>'; | |
} | |
add_filter('wp_nav_menu_items','be_menu_extras', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment