If you are looking for a function that get the last segment from a url, this is what you want. Just copy it into your functions.php.
//get last segment from url
function get_last_segment( $url ) {
$path = parse_url( $url, PHP_URL_PATH ); // to get the path from a whole URL
…


(4.00 out of 5)
