404 error caused due to certain form element names in WordPress

One day I decided to help people out on Stackverflow with what little knowledge I had. I came across question where a user was facing a 404 ERROR when submitting a form on the page. The user was redirected to the same page when the form submitted but with 404 ERROR while that was not the case if the user visited that page directly.

Did some debugging and found that he had a value as “name” for the “name” attribute of the field which was causing the issue. It seems that WordPress uses some of these variables in its query, so submitting a form that has a field with the same name throws off the query and causes a 404 ERROR. So far I’ve found reports of these words being reserved.

  • name
  • date
  • year
  • month
  • day
  • hour
  • minute

So, try not to use these words as the value for the “name” for any form fields in your WordPress site.

 

 

Retain HTML font-size when changing orientation in iPhone

Unlike other devices, IOS devices has a tendency to manipulate different things on the browser based on the different situations and interactions.

One of such thing is that it changes the font size of the webpage when the orientation of the device changes, obviously for a better cause i.e enhancing the readability of the content. But sometimes the change in the font size on changing orientation of device catches the eye and may not look good or you just want to keep the font size uniform for the Portrait and the Landscape view.

You can add this property in you CSS file to disable the auto resizing of fonts in iPhone.

body {-webkit-text-size-adjust: none;}

You can put this code in Media Queries like this to prevent it from disabling the font resize in desktop browser.

@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
body {-webkit-text-size-adjust: none;}
}