Time based navigation
-
Hi Ladies and Gentleman!
I guess there’s no (built in) function available for my problem, so I’ll ask you π
I tried to develop a time based navigation menu.
f.e. I’m having one page for each weekday and on monday the menu-item of monday should be the first item in the menu’s list.So I wondered, if it’s possible to build a navigation with feeding a function with an array of page-id’s instead of custom menus… like
mySuperCoolMenu(array(5,6,7,8));’cause I found no possibility to dynamically modify my custom menus I’ve created in WordPress.My final guess is to build a function which builds a menu while using
the_title()andget_page_link().Maybe someone already came up with a solution for my issue and wanna share some code snippets or something π
Thanks alot in advance
Daluxe
-
Quick idea, but haven’t written out the code.
Create a
wp_nav_menufor each day. Create a function that would include a switch statement to display the appropriate menu based upon day of week.function ngtj_day_of_week_menu() { $day_of_week = date( 'N' ); switch( $day_of_week ) { case 1: wp_nav_menu( MENU FOR MONDAY ); break; case 2: wp_nav_menu( MENU FOR TUESDAY ); break; etc... } }Hey Nate!
Thanks for your idea. The thing is, that I don’t want to create a custom menu for each day, ’cause there are more menus to come soon.I found the function
wp_page_menu()which may fit for me, ’cause I could feed the function with an include parameter. I’ll take a look on that function and tell you how it works out for my purpose.
The topic ‘Time based navigation’ is closed to new replies.