The Farbtastic Color Picker is a fantastic tool for developers and designers to utilize as a way to give their plugin (or theme) users an extra level of control. With Farbtastic, we can allow our users to change the colors of certain elements, such as the background color of our widget, by using an elegant [...]
View PostLoad 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 [...]
View Post Scripts. styles, short codes, shortcodesAdd Already Registered Taxonomy to Custom Post Type
Sometimes, when using a custom post type in your plugins (or themes), it is desirable to add the already-registered taxonomies (Post Tags and Categories by default) to your custom object type. This quick code snippet will show you how to do that.
View Post custom post type, taxonomyChange “Enter title here” Text for Custom Post Types
Custom Post Types are an increasingly popular tool for WordPress developers to use when constructing their plugins. There are many, many little tricks that help to make the finished product more polished, and one of those is changing the “Enter title here” text that is displayed in the Post Title field on the edit screen. [...]
View Post cpt, custom post type, rewriteSimple Recent Posts Widget
This next part in our Working with Widgets Series is going to show you how to create a simple recent posts widget, much like my Better Recent Posts Widget plugin, though it will be even simpler. The goal of this tutorial will be to demonstrate a very useful technique that you can use in countless [...]
View Post get_posts, recent posts, widget, widgetsSimple WordPress Widget Template
Widgets are utilized by tons of WordPress themes and plugins as a way to display customized content in various locations, and they’re relatively easy to create, as long as you have the appropriate resources. The code below will give you everything you need to make extensive and advanced widgets that can do anything you want. [...]
View Post widgetsLoad Scripts on Plugin Pages Only
Loading scripts, CSS and jQuery, within a plugin for use on admin pages is one of the most common areas that developers make mistakes. If you plugin’s administrative pages require any scripts that are not already loaded in WordPress by default, you should always ensure that those scripts are only loaded on your plugin’s page, [...]
View Post CSS, jquery, ScriptsCreate an Ajaxified Contact Form Short Code
A very popular feature of many themes is an Ajaxified contact form, often inserted through a shortcode. So I’m going to show you how to create one from scratch as a plugin that can be dropped into any WordPress theme.
View Post Ajax, contact form, short code