Skip to content

Instantly share code, notes, and snippets.

@INDIAN2020
Created February 7, 2013 09:08
Show Gist options
  • Save INDIAN2020/4729728 to your computer and use it in GitHub Desktop.
Save INDIAN2020/4729728 to your computer and use it in GitHub Desktop.
getid
global $wpdb;
$post_name = get_query_var('name');
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = $post_name");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment