title: Why would Wordpress throw a 404 error on a POST form submit in one template, but not in another?
body: <p>I've developed a php mail() function for custom forms in a Wordpress theme. It's just a normal form that gets submitted to itself (with an empty <code>action</code> attribute). In functions.php, I'm including <code>inc\mail.php</code>, which checks whether POST data is present, and if so, it runs the function. In the end, the function sends an email via php's <code>mail()</code> and returns true.</p>
  
  <p>This works perfectly for a single post that has a custom post type (not "post" or "page"), but when I try to use the same script on a normal Wordpress "page", it runs the function as well (and sends the email), <strong>but then it throws a 404 error.</strong> The URL in the browser address bar is unchanged (shows the permalink of the page), but it doesn't seem to find the page.</p>
  
  <p>Then, if I refresh the page (without sending POST data again), i.e. by clicking on the browser address bar and hitting Enter), <strong>it shows the right page again as usual.</strong></p>
  
  <p>I'm stumped. Why would it do that?</p>
  
  <p>Edit: found the solution here: <a href="https://wordpress.stackexchange.com/questions/11749/why-when-i-submit-a-form-in-wordpress-it-loads-a-404-page-though-url-is-correct">https://wordpress.stackexchange.com/questions/11749/why-when-i-submit-a-form-in-wordpress-it-loads-a-404-page-though-url-is-correct</a> thanks to @DigitalDesignDj's suggestion to look there.</p>