Adding Custom Meta Fields to Taxonomies

It is pretty common knowledge that custom meta fields can be added to posts, pages and custom post types, but did you know that you can add custom meta fields to post tags, categories, and custom taxonomies as well? It’s actually pretty simple, though relatively undocumented. So in this quick tutorial I’m going to walk…

Retrieve Users Based on Meta Value

Just like the post meta system, WordPress has a powerful user meta system that allows developers to store additional “meta” information about the registered users in the database. This meta information can be just about anything you want it to be, and can serve a variety of purposes. At the time of writing this tutorial,…

Filter Posts by Custom Taxonomy in Admin

If you have lots of posts in your WordPress site, you have probably used the Category and/or Tag filters at the top of the post list page. These filters are great because they very quickly allow you to limit the kind of posts that are displayed, and let you find the one(s) you are looking…

Localizing and Translating WordPress Plugins

In order to be kind to our friends that do not speak the language we have written our plugin in, it is always a good idea to fully localize your WordPress plugin. This means make it “ready for translation”. If you are one of those that is blessed with the fluency of more than one…

Write an Advanced Maintenance Mode Plugin

This tutorial explains the process behind writing a Maintenance Mode plugin for WordPress such as the one I released a few days ago: CGC Maintenance Mode. The final result of this tutorial will give you an advanced plugin capable of putting your site into maintenance mode, while allowing authorized users to view the site normally,…

Process Ajax Requests Correctly in WordPress Plugins

WordPress provides a set of great tools for processing ajax requests in plugins (and themes). I’m going to give you a quick example of how these tools can be used to accomplish a variety of tasks. For this example, We’ll just be using some simple alerts, but they will serve very well for demonstration purposes.

Custom Post Type Calendar Widget

The other day a user posted a question on the WordPress Stack Exchange about how to display a calendar of your site’s custom post types, much like the default WP Calendar widget. After a quick google search, I found a function written by Jennifer Dodd that did exactly this. The user who asked the question…

How to Create Advanced WordPress Widgets – @wproots

Creating WordPress widgets, from simple to advanced, is not a very difficult task, though it can be hard to get into developing them if you do not have the right tools. This tutorial, written at WP Roots, will give you everything you need, including an example, to begin writing advanced WordPress Widgets. This entry is…

Load Scripts if Post has Short Code

This is a really handy trick that I just learned today. Whenever we can, it is always best to only load styles and scripts for our plugins when they are needed. This tutorial will show you how to load stylesheets and scripts only when a post contains the short code that the styles / scripts…

Write a Better Related Posts Plugin for Custom Taxonomies

Related Posts Plugins are very popular as a method for WordPress users to display related content at the end of their posts, providing the reader with additional relevant content. Typically, related posts plugins use Post Tags to compare posts and find those that are related to the currently displayed post.

Post Data with Ajax in WordPress Plugins

In this tutorial I am going to cover how to use Ajax to submit and process form data in your WordPress plugins. In order to tie things together, and to provide you a real world example, I am going to be working with the code used in my Short Code Contact form plugin.