WordPress.org

Ready to get started?Download WordPress

Forums

Dropdown Menus
Dropdown select box for mobile? Job done! (1 post)

5 stars
  1. jon.evans
    Member
    Posted 1 year ago #

    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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.