Display your WordPress menus as a dropdown select box. Great for mobile designs.
I never imagined this would be as easy as it was. In my case I'm using a specific mobile theme and a switcher plugin. Four simple steps:
1. Upload dropdown-menus.php file in /dropdown/ folder of Mobile theme
2. Add code to mobile theme's function.php to 'include' the plugin (not sure if this is necessary):
if ( ! function_exists( 'dropdown_menu' ) )
include( 'dropdown/dropdown-menus.php' );
3. Add dropdown_menu function call code to header.php, e.g. below logo, see plugin description. Something like:
$ddargs = array(
'dropdown_title' => '[Main Menu]', // text to show when on page not in menu
'indent_string' => '- ', // text to show before 'indented' sub-menu item, repeated
'indent_after' => '' // text to show for sub-menu, NOT repeated
);
dropdown_menu( $ddargs );
4. Style CSS: e.g. Add css to Mobile theme's style.css
.menu-top-menu-container {
padding:5px;
background-color: #e2e2e2;
}
Thanks!
You must log in to submit a review. You can also log in or register using the form near the top of this page.