Title: Using wp_is_mobile in a theme
Last modified: August 30, 2016

---

# Using wp_is_mobile in a theme

 *  [heytricia](https://wordpress.org/support/users/tendigit/)
 * (@tendigit)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/using-wp_is_mobile-in-a-theme/)
 * I’m trying to prevent loading of all site menus on mobile. I’d rather not load
   them at all as opposed to loading them and hiding them with css. I’m starting
   with this in my header file:
 *     ```
       <?php if(wp_is_mobile()) : ?>
       	<?php /*?>Don't load full menus on mobile<?php */?>
       <?php else : ?>
                //Code for additional menus goes here
       <?php endif; ?>
       ```
   
 * It works, but I pushed this change on Friday – and our site is timing out this
   week. It could be totally unrelated, but I found a statement in the codex that
   says ” It also should not be used for themes.” – [https://codex.wordpress.org/Function_Reference/wp_is_mobile](https://codex.wordpress.org/Function_Reference/wp_is_mobile)
 * Does this mean I can’t use the function in this way? I found several references/
   examples like the logic I used. If not in a theme, how can I use it?

The topic ‘Using wp_is_mobile in a theme’ is closed to new replies.

## Tags

 * [wp_is_mobile](https://wordpress.org/support/topic-tag/wp_is_mobile/)

 * 0 replies
 * 1 participant
 * Last reply from: [heytricia](https://wordpress.org/support/users/tendigit/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/using-wp_is_mobile-in-a-theme/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
