Title: Function that hides page
Last modified: August 22, 2016

---

# Function that hides page

 *  [Ligefrem](https://wordpress.org/support/users/ligefrem/)
 * (@ligefrem)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/function-that-hides-page/)
 * I’ve got snakkeriet.dk
 * It’s build on a non-responsive one-page theme so I have a mobile theme and a 
   theme switcher for mobile devices. I’ve creted some pages that are just for the
   mobiel theme, but since the main theme is a one-page theme ALL pages are shown
   in the menu and on the frontpage. I need to write a custom function that hides
   the “mobile only” page in the main theme. How do I do this?

Viewing 1 replies (of 1 total)

 *  [Nik](https://wordpress.org/support/users/nvourva/)
 * (@nvourva)
 * [11 years, 7 months ago](https://wordpress.org/support/topic/function-that-hides-page/#post-5431281)
 * Hello. You can use [wp_is_mobile](http://codex.wordpress.org/Function_Reference/wp_is_mobile)
   in a conditional statement. Wrap the mobile pages with it and they will only 
   appear on mobile devices. You can also combine it with a custom field on your
   posts so you can get something like a checkbox, which if checked will hide the
   posts from non mobile devices.

Viewing 1 replies (of 1 total)

The topic ‘Function that hides page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Nik](https://wordpress.org/support/users/nvourva/)
 * Last activity: [11 years, 7 months ago](https://wordpress.org/support/topic/function-that-hides-page/#post-5431281)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
