Created
March 25, 2019 15:04
-
-
Save lindseyriel/c713cd128a7fe2e181360ec0bb84d060 to your computer and use it in GitHub Desktop.
Add Date to Primary Navigation Bar
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
//* Add Date to Primary Navigation | |
add_filter( 'wp_nav_menu_items', 'theme_menu_extras', 10, 2 ); | |
function theme_menu_extras( $menu, $args ) { | |
//* Change 'primary' to 'secondary' to add extras to the secondary navigation menu | |
if ( 'primary' !== $args->theme_location ) | |
return $menu; | |
$menu .= '<li class="right date">' . date_i18n( get_option( 'date_format' ) ) . '</li>'; | |
return $menu; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment