title: display error message on wordpress login
body: <p>i want to display error message on wp-login form when captcha code is incorrect.. i m using 'login_redirect' and 'login_errors' filters..here is my code..</p>
  
  <pre><code>add_filter( 'login_redirect', 'captcha_login_check', 10, 3);
  add_filter( 'login_errors', 'captcha_login_post' );
  function captcha_login_check($username, $password)
  {
  if (isset($_POST["security_check"])) 
  {
      $code = str_decrypt($_POST["security_check"]);
      if (!( empty($code)) &amp;&amp; !($code == $_POST['security_code'] ) &amp;&amp; ($password == false))
      {
          function captcha_login_post($error)
          {
              return $error."&lt;p&gt;&lt;span style='color:red'&gt;Error, the Security Code does not match. Please Try Again.&lt;/span&gt;&lt;br&gt;&lt;/p&gt;";
          }
  
      }
      else if(!( empty($code)) &amp;&amp; !($code == $_POST['security_code'] ) &amp;&amp; ($password == true))
      {
          $url = get_site_url().'/wp-login.php'; 
          header('Location:'.$url);
          echo  "&lt;p&gt;&lt;span style='color:red'&gt;Error, the Security Code does not match. Please Try Again.&lt;/span&gt;&lt;br&gt;&lt;/p&gt;";
  
      }
      else
      {
          $url = get_site_url().'/wp-admin'; 
          header('Location:'.$url);
      }
  }
  </code></pre>
  
  <p>}</p>