View Single Post
Old 11-09-2009, 08:28 AM  
HowlingWulf
Confirmed User
 
HowlingWulf's Avatar
 
Join Date: Nov 2001
Posts: 1,662
If it's a wordpress plugin just use the wordpress functions to get the id in or out of the loop. A google search will show you how.

If you need to use the url then try
function get_post_by_title($page_title, $output = OBJECT) {
global $wpdb;
$post = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type='post'", $page_title ));
if ( $post )
return get_post($post, $output);

return null;
}
__________________
WP Porn directory/review theme Maddos $35.

webmaster AT howling-wulf.com
HowlingWulf is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote