Skip to content

Instantly share code, notes, and snippets.

@ninetwentyfour
Created August 28, 2011 19:14
Show Gist options
  • Save ninetwentyfour/1177074 to your computer and use it in GitHub Desktop.
Save ninetwentyfour/1177074 to your computer and use it in GitHub Desktop.
If is_page() With Regular PHP - blogpost
<?php
$baseurl = 'http://www.example.com'; //set the base url of the site
$pageYouWant = $baseurl."/the-rest-of-the-url"; //add the rest of the url you want to check against
$currentPage = $baseurl.$_SERVER['REQUEST_URI'];// this gets the current page url
if($pageYouWant==$currentPage) {
//do something
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment