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);

Share this snippet


Comments (1) - Leave yours

Leave a Reply

Your email address will not be published. Required fields are marked *

Please respect the following rules: No advertising, no spam, no keyword in name field. Thank you!