Revision: 31373
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 3, 2010 18:29 by levinet
Initial Code
function getPageByName($page_name) { global $wpdb; $page_name_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."'"); return $page_name_id; }
Initial URL
Initial Description
Returns the post or page id using the name/slug of a page.
Initial Title
WordPress - Get Post or Page ID By Name
Initial Tags
php, page, wordpress
Initial Language
PHP