There is many ways to pass dynamic variables to JavaScript. An easy way would be just to define the JavaScript variables in the <head> echoing the PHP variables. This will of course work, but there is a WordPress-way to do…
There is many ways to pass dynamic variables to JavaScript. An easy way would be just to define the JavaScript variables in the <head> echoing the PHP variables. This will of course work, but there is a WordPress-way to do…
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…
The Rich Text Editor (RTE) in WordPress use a JavaScript-library called tinyMCE. It is a widely used library and can be configured in a lot of ways. WordPress let developers filter the settings to tinyMCE so that it fits your…
If you want to list your posts and order them by title, that is as simple as: But if you are using international characters and/or another alphabet the default database settings may mess things up for you. In Sweden for…
This will only work with Mac OS X and Apache. I have many WordPress installations locally. All of which grows outdated as time flies by. Normally I don’t worry about it since the live version is easily upgraded with WordPress…
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…
Turn your WordPress blog into a Tumblresque blog with Post Formats. Post Formats, introduced with Version 3.1, are meta information that can be used by themes to customize presentation of a post. The basic idea is to provide a specific…
I wrote some simple code so that you could query posts from another blog on your site by using the argument blogid in your query So how does it work? It work pretty well with little, or no testing so…