WordPress.org

Ready to get started?Download WordPress

Forums

Responsive Select Menu
[resolved] Links don't work / Both menu's always displaying !SOLUTIONS! (2 posts)

  1. ashbullman
    Member
    Posted 7 months ago #

    Hi Everyone.
    This is a great plugin and when set up properly it works a dream! Fantastic effort from the creators.

    However it did take me some time to get it working. I had the double menu issue and then the mobile links didn't work.

    I did solve these on my own and thought I'd share my findings with this forum in case it can be of use to others,

    Both desktop and mobile menus appear on all sizes:
    Turns out i had to wrap my wordpress menu code in a <nav> </nav>tag. then add a css class for 'select', and another class for the menu's desktop list 'ul'. Then show the ones you want and hide the others through media queries. my css to display only the mobile nav was:

    'nav .menu-header ul {
    display: none;
    }
    select {
    display: block;
    }'

    the html
    '<nav>
    <?php wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary' ) ); ?>
    </nav>'
    ---
    Container class of menu-header as above being a set of rules that define how the main menu looks on desktop etc (hence the css of nav .menu-header ul to hide / show the desktop list of links).

    The Mobile links not working was slightly easier to figure. Some plugins require a bit of code to work properly, but this isn't always well stated. Simply added:

    '<?php wp_head(); ?>'

    to every page/ template underneath the

    '<?php get_header("header.php"); ?>'

    (!Not in place of it) and Wham! it works perfectly. Remember this for any other plugins you have issues with.

    Well anyways, bit long, but if I can help someone else who is struggling then it's worth it.

    (Apologies if my code is not forum friendly, don't often write on them!)

    Ash
    http://wordpress.org/plugins/responsive-select-menu/

  2. sevenspark
    Member
    Plugin Author

    Posted 7 months ago #

    Hi Ash,

    Glad you've got the plugin working and you're liking it :) Thanks for sharing your experience. For your reference:

    wp_head() is a requirement for every theme, and should be placed in the header.php. So is wp_footer(). Themes without these critical hooks will not be compatible with any plugin that requires CSS or Javascript. If you've installed a theme that doesn't include those hooks, you should switch to a different theme, as the theme is not following WordPress standards.

    You shouldn't need to wrap your wp_nav_menu function in anything or add classes manually. It's possible your theme was filtering the menu output and causing problems that way.

    Best,

    Chris

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.