Created
April 1, 2015 08:11
-
-
Save dededey/a0419d29b0f9d76ea708 to your computer and use it in GitHub Desktop.
get wp segment uri
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
$segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/')); | |
$numSegments = count($segments); | |
$currentSegment = $segments[$numSegments - 1]; | |
echo 'Current Segment: ' , $currentSegment; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment