I have a child theme. Within the child theme, I have a custom page template. It work perfectly on a desktop. It is not working on my iPhone with the Safari browser.

This is the template:


define('WP_USE_THEMES', false); //This code stops the theme files from loading

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

while (have_posts()) : the_post(); 

//Get post ID - create html element to store it
echo "<div id=postID>".get_the_ID()."</div>" ;


Notice how the template does not load the theme files, header or footer. Yet when I open the page on my iPhone, the header and footer are there. In addition to that, all the theme files are loaded. It seems as though the template is being ignored on mobile.

How can I fix this?

  • Do you really think that theme's templates are so smart to understand are you mobile or not? – Max Yudin Mar 21 '17 at 9:44
  • Really, you define WP_USE_THEMES in a template that is loaded by the theme? – fuxia Mar 21 '17 at 10:15
  • Everything works perfectly on desktop but not on mobile. What do you suggest? – Lumo5 Mar 21 '17 at 13:30

The Jetpack plugin has its own mobile theme, which is overriding the child theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.