Last active
August 29, 2015 14:23
-
-
Save badcrocodile/fb5473bbadb918d3e426 to your computer and use it in GitHub Desktop.
Compare permalink to current URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* -- Compare the URL to the permalink, return true if matches -- */ | |
| function is_current_page($permalink) { | |
| $url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; | |
| if (strpos($url,$permalink) !== false) | |
| return true; | |
| else | |
| return false; | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment