Dropdown select box for mobile? Job done!
-
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!
- The topic ‘Dropdown select box for mobile? Job done!’ is closed to new replies.