If you would want to write a phrase in single or plural form depending on a number, there is a very handy function for it written in WordPress called _n. The function also takes a $domain argument which can be handy when…
If you would want to write a phrase in single or plural form depending on a number, there is a very handy function for it written in WordPress called _n. The function also takes a $domain argument which can be handy when…
In a collaborative programming environment it is always good to have a set of coding standards that you follow. Thankfully, WordPress have coding standards which all developers should try to follow. If you peek at the WordPress source you will…
I have used Custom Post Types in almost every WordPress project I have worked on since the feature was introduced in WordPress 3.0. When collaborating with other developers you also come across some common mistakes, mistakes that I’ve also made…
During development WordPress provides you with another error reporting tool apart from the normal PHP errors and warning. Edit your wp-config.php file and find the row where WP_DEBUG is defined and set it to true. This will make your site…
Today while working on a project where we had collaborated with freelance developers I noticed that some pages weren’t looking as they should. A quick glance at the code revealed that the developer was using “short tags” to include the…
When I’m not developing for WordPress, I try to use a specific folder structure for my project. I have all my .css-files in the /css/-folder, all JavaScript in /js/-folder and so forth. I tried to keep this up for WordPress,…
When developing a simple form to use in your WordPress theme or plugin you often want to post to the same page. To do so, simply leave the action attribute empty in your form. Notice that your_name is used, using…
The function body_class was introduced in WordPress 2.8 and should be included in every theme. Include it in your HTML like so: And you will end up with something like this It can come quite handy when you want pages…