How to get page’s ID if I know the title only?

Is there an exact opposite funciton to this one: get_the_title(ID) I know there’s: get_the_id() But it doesn’t seem to accept any arguments. So, basically, I’m looking for something like: $title=”Something”; get_the_id($title); I already know this solution: global $wpdb; $post_name = get_query_var(‘name’); $post_id = $wpdb->get_var(“SELECT ID FROM $wpdb->posts WHERE post_name = $post_name”); But maybe there’s something … Read more