Title: functions.php
Last modified: August 21, 2016

---

# functions.php

 *  [redbobo](https://wordpress.org/support/users/redbobo/)
 * (@redbobo)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/functionsphp-9/)
 * 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)

 *  [Wil](https://wordpress.org/support/users/limecanvas/)
 * (@limecanvas)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/functionsphp-9/#post-4522104)
 * 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/](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](https://wordpress.org/support/users/redbobo/)
 * (@redbobo)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/functionsphp-9/#post-4522106)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [redbobo](https://wordpress.org/support/users/redbobo/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/functionsphp-9/#post-4522106)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
