Get post ID from slug

"url_to_postid" is the only way to retrieve a post ID from a slug. Just add the entire slug of a post to find the ID.


$ID = url_to_postid(slug);