I've had the same code on my wordpress site for more than a year, and it's stopped working. This is part of page.php:
<?php
if (is_page( 83571 )) {
include('adsense-schools.php');
} else {
include('adsense.php');
}
?>
Previously, this used to work, but today I noticed that it is not working correctly. adsense.php is included on all other pages, but adsense-schools.php does not show on page 83571. (And I have checked to make that sure that page id didn't change, the URL when editing that page ends in ...wp-admin/post.php?post=83571)
I also tried changing to page title instead of page id number, so
<?php
if (is_page( 'international-schools' )) {
include('adsense-schools.php');
} else {
include('adsense.php');
}
?>
But that didn't work either. Am I missing anything?
is_page()
is for front-end use, not use in the admin panel. Might be easier to just check against$_GET['post']
– Howdy_McGee♦ Apr 7 at 14:3283571
is a post type = page and not a post or some other post type? – Howdy_McGee♦ Apr 7 at 16:29