get post by title

function get_post_by_title($page_title) {
   global $wpdb;
   $post = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s ", $page_title ));
   if ( $post )
      {
      $post= get_post($post, $output);
      //print_r($post);
      $language=get_bloginfo('language');
      if($post->post_type=="research"){
      $research_language= get_post_meta($post->ID, 'language', true);
     //  print $research_language. "   ".$language;print "<hr>";
     if($research_language!=$language)
      return false;
     else
       return true;
  }
}

  //  return null;
}
Advertisements

About lorddisk

WebCenter Content, WebCenter Portal, WebCenter Sites,Weblogic, Identity and Access Management (IAM),SSO,OAM,OIM,OAAM,OUD, OPAM,OID, OVD ,Oracle API Gateway ,OBIEE,OEDQ, Oracle ADF, Oracle SOA,J2EE, CackePHP ,PHP,J2SE,J2EE,Spring,Hibernate,JQuery,CSS,Java Script ,Joomla,Drupal,Worpress
This entry was posted in wordpress. Bookmark the permalink.