title: Can a login be made using custom post types and custom fields (ACF)?
body: <p>Is it possible to make a login system using WordPress custom post types and advanced custom fields?</p>
  
  <p>I've created a custom post type called 'Users' where I have this structure:</p>
  
  <ul>
  <li>the post title</li>
  <li>user email (a field of type text using ACF)</li>
  <li>user password (a field of type password using ACF)</li>
  </ul>
  
  <p>With the help of these I practically register the users myself as I want to.</p>
  
  <p>My problem is with the structure of the database where is this saved, because of I think I can't login the user from a front login form.</p>
  
  <p>I tried some queries but something doesn't seem right. Can someone help me please with this. I am on the right track or not? </p>
  
  <pre class="lang-php prettyprint-override"><code>$login_email = $_POST['login_email'];
  $login_password = $_POST['login_password'];
  
  $email_sql = $wpdb-&gt;get_var($wpdb-&gt;prepare("SELECT meta_value FROM ".$wpdb-&gt;postmeta." WHERE meta_key = %s AND meta_value = %s",'user_email', $login_email));
  
  $pass_sql = $wpdb-&gt;get_results($wpdb-&gt;prepare("SELECT meta_value FROM ".$wpdb-&gt;postmeta." WHERE meta_key = %s AND meta_value = %s",'user_password', $login_password));
  </code></pre>
  
  <p>The thing is that both user email and user password are meta_key and they are not the same record and I think I can't make a login based on that. Am I right or there is a way? </p>