Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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;
Source by wordpress.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #wordpress #page #slug
ADD COMMENT
Topic
Name
3+7 =