• 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)
  • Hello. You can use 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.