Hi guys.
How do I get in php code the current page in wich I am (with complete permalink structure with slugs and so on) ?
Hi guys.
How do I get in php code the current page in wich I am (with complete permalink structure with slugs and so on) ?
You can always use the $_SERVER['REQUEST_URI']. This of course will have any url-encoded query strings tagged on it as well, but you can quickly get rid of that with an explode. For example:
$page = array_shift( explode( '?', $_SERVER['REQUEST_URI'] ) );
If you still want the query string, simply use $_SERVER['REQUEST_URI'] as is.
Will that work for you?
This topic has been closed to new replies.