gang, Here's a fun one. I'm trying to get a (regular ol')

Hey gang,

Here’s a fun one. I’m trying to get a (regular ol’:wink: menu item to appear only on non-desktop viewports. I’ve tried a few different angles:

A separate theme and theme-switcher. For some reason (I’m using Twenty Fourteen here, and I’ve tried killing all plugins) it doesn’t work.

If Menu and WP Mobile Detect. If Menu doesn’t recognize WPMD’s new functions.

I’m sure this can be done, and probably easily. Any ideas? Thanks!

  • Vinod Dalvi
    • WP Unicorn

    Hi Adam,

    I hope you are well today and thank you for your question.

    Here’s a fun one. I’m trying to get a (regular ol’:wink: menu item to appear only on non-desktop viewports. I’ve tried a few different angles:

    By default it displays UL so do you want to display ol instead of UL on non-desktop viewports, means on mobile viewports?

    Could you please tell me in short what you are trying to achieve and why so that i can help you to do it?

    Kind Regards,

    Vinod Dalvi

  • Adam
    • The Incredible Code Injector

    I googled and this is how I ended up solving it.

    Assign a unique class to the menu item: mobile-only

    Use media queries to hide the item if it’s on a desktop display:

    @media only screen and (min-width: 959px) { ul > li.mobile-only { display: none!important; } }

    Done!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.