wordpress get current page name code example
Example 1: get current page slug
$slug = get_queried_object()->post_name;
Example 2: get page name wp
$slug = basename(get_permalink());
//or
$wp_query->queried_object->post_name
Example 3: get the current page id in wordpress
$page_id = get_queried_object_id();