Blog Archives

Using PHP variables in JavaScript with wp_localize_script

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

Tagged with: , , , ,
Posted in Intermediate

Use _n to write a phrase in single or plural form

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

Tagged with: , , , , ,
Posted in Best Practices, Intermediate

Remove title attribute from WordPress images

I use default WordPress functions to insert images very often. Functions like the_post_thumbnail or wp_get_attachment_image are used in almost every project I do. By default WordPress adds a title to all of the images printed by these functions, and the title usually

Tagged with: , , , , ,
Posted in Intermediate

WordPress Coding Standards

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

Tagged with: , ,
Posted in Best Practices, Intermediate

Add your own CSS classes to tinyMCE

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

Tagged with: , , ,
Posted in Intermediate

Fix sort/order with post_title for international characters

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

Tagged with: , , ,
Posted in Intermediate

Automaticly upgrade your local WordPress installation

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

Tagged with: ,
Posted in Intermediate, Misc

Set WP_DEBUG to true during development

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

Tagged with: , , ,
Posted in Best Practices, Intermediate

Post Formats

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

Tagged with: ,
Posted in Intermediate

Query another blog on your site

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

Tagged with: , , ,
Posted in Intermediate
About

WordPress Quick Tips is a blog supplying great tips about WordPress.

We hope to create a great knowledge resource for WordPress developers as well as serving a reminder for all the forgetful ones.

The blog is created and run by Vincent of Oakwood Creative

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 121 other followers