Answers for "wordpress current url with slugs"

PHP
1

wordpress get page slug

// Get the queried object and sanitize it
$current_page = sanitize_post( $GLOBALS['wp_the_query']->get_queried_object() );
// Get the page slug
$slug = $current_page->post_name;
Posted by: Guest on March-02-2021
-1

current url wordpress

global $wp;
echo home_url( $wp->request )
Posted by: Guest on February-08-2021

Browse Popular Code Answers by Language