How to add the Date to the WP Navigation
Copyright © 2011 Yorgo Nestoridis. Visit the original article at http://yorgonestoridis.com/yorgo-nestoridis-development/wordpress-yorgo-nestoridis-development/how-to-add-the-date-to-the-wordpress-navigation/.Add the Date to WordPress Navigation Menu This post shows you how you can quickly add the date to your WordPress Navigation (Menu). This post is in line with the earlier tutorial about “How to add a search Box to the WordPress Navigation”. WordPress Functions and Style The procedure is simple: we just need to add the function and style it there after. Add the Date Function The following will work on any well designed WordPress theme. Add the following lines to your functions.php: add_filter('wp_nav_menu_items','add_date', 20, 2); function add_date($items, $args) { $items .= '<li>' . date("l F jS, Y") . '</li>'; return $items; } If you wish to style the date independently from the navigation styles, you just need to add a div class, for example: ‘navdate’ like this: add_filter('wp_nav_menu_items','add_date', 20, 2); function add_date($items, $args) { $items .= '<li class="navdate">' . date("l F jS, Y") . '</li>'; return $items; } Note on line 3 the inserted li class ‘navdate’; this link class allows us to style the date using our stylesheet (styles.css or custom.css as the case may be). Add Style To add style, we just create the new class [...] Related posts:How to show a Search Box on the WP Navigation Web Design Workshop 5 – Sub-Navigation Web Design Workshop 4 – Navigation Mitchell & Ness Snapback Caps in Stock Web Design Workshop Navigation





April 15, 2011
0