Home › Forums › Back End › single page mobile redirect: › Reply To: single page mobile redirect:
December 11, 2014 at 10:53 pm
#190654
Participant
get_the_ID
can only be used within a WordPress Loop. If you need to get the ID outside, check out this.
But I would handle this differently by:
- Create a page template
page-{id}.php
- Only check for mobile
No need to check for current state from your functions on every load. Corresponding template will only load when that page loads so we off load that responsibility.