• I have a custom wp theme which I have primary navigation. I also have a jQuery toggle navigation when in mobile form. My primary navigation shows up in the toggle navigation in the correct format and hides in desktop mode. The primary navigation is setup with uncategorized topics for the drop down in the full website. My question here is there a way in functions.php to add an if else statement to use wp_list_pages when in mobile form or is there an if else statement which use another menu in mobile form?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Not really no.

    Not unless you download and use a script which is able to detect mobile devices e.g. https://code.google.com/p/php-mobile-detect/

    Why not just develop two menu separate divs, content fed from two separate php functions and then hide one of them using CSS and media queries?

    Wil.

    Thread Starter redbobo

    (@redbobo)

    I have tried that but Iwith wp_list_pages and wp_nav_menu for the mobile div. It reads too show both navigation at the same time. I have used the same jquery for several html websites in the past but have never used it in a wp theme. It’s not a good idea to put a lot of JavaScript In WordPress because they have the built in JavaScript. So I’m trying to avoid that and trying to do things right on this website to avoid problems in the future.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘functions.php’ is closed to new replies.