title: How to get page id by page title in wordpress
body: <p>I am not able to get page id by page title in these cases when the words as space in between</p>
  
  <ol>
  <li>just think </li>
  <li>How are you</li>
  </ol>
  
  <p>but I am able to get id when it is single word title like "user"</p>
  
  <p>My code goes here</p>
  
  <pre><code>function get_ID_by_page_name($page_name)
  {
      global $wpdb;
      $page_name_id = $wpdb-&gt;get_var("SELECT ID FROM $wpdb-&gt;posts WHERE post_name = '".$page_name."'");
      return $page_name_id;
  }
  
  
  
  $thinkid = ks_get_option('ks_thinkid'); //getting page title from theme option
  echo $thinkid; // works successfull till this 
  
  $the_page_id = get_ID_by_page_name($thinkid);
  echo $the_page_id;
  </code></pre>