By A Niraj Kumar on November 12, 2009
Hello friends,
I am sure! Once or ever you must have been searching for a function in wordpress which can just convert your page name or post name into Page Id. Wow! I have the solution. Please try this code let me know your experiences.
function wt_get_ID_by_page_name($page_name)
{
global $wpdb;
$page_name_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_name = '".$page_name."'");
return $page_name_id;
}
Posted in Php n MySQL, Wordpress | Tagged get ID by page name, get ID from post name, php functions, wordpress, wordpress expert
Hi, I am Chief Executive Officer (CEO), Webchilly Infoways, India and a 4 years experienced Leading Software Developer from southern (Visakhapatnam) india. With key skills PHP, XHTML, CSS, MySql, Ms Msql, VB.NET, AJAX, SEO, Photoshop. I work as Web Designer, Developer, Software Application Developer and SEO as well. I am one of the best WordPress Developers, Joomla, PHPBB, DRUPAL, Magento Experts, PSD to XHTML,CSS Experts from India.
Recent Comments