Better Blockquotes

WordPress has a button in the editor for adding blockquotes to a post. But what if an author wants to add a citation? Unfortunately, it’s not possible without a little HTML knowledge.

This is a problem I’ve thought about a bit when designing DevPress themes (what markup should I be styling for?), but it’s also come up on a few client projects recently. Citations are a pretty common use-case, and it would be great if they were easier to add.

My solution was to build a plugin that replaces the existing TinyMCE button for blockquotes with an enhanced one. Continue reading

Using Mandrill for WordPress Email

WordPress sends e-mail notifications for a number of different reasons. New user registration, password resets, and comment notifications are the common defaults.

Plugins also tap into the e-mail system too, especially for extensions that add contact forms, e-commerce or subscription functionality.

logout-mandrill

If e-mail is integral to your WordPress site, you might want to consider using Mandrill (a service by the folks behind MailChimp) rather than the default WordPress mail system. If your server doesn’t allow mail scripts or have a mail server, this might even be essential (and an alternative to running it through SMTP using a plugin like this). Continue reading

Custom Post Type Boilerplate

I was doing a WordPress project this week that required four custom post types along with associated taxonomies and metaboxes. It’s been a while since I’ve done client work, and realized I didn’t have good boilerplate code to build these custom post type plugins from.

In the past, I’ve altered the “Portfolio Post Type” plugin which I’ve written but this has become more specialized for portfolios as Gary Jones and I have worked on it and isn’t as great a starting place as it used to be.

Team post type with metaboxes.
Team post type with metaboxes.

I think it’s really important to have quality code lying around for items like this. Building a custom post type (and especially metaboxes) from scratch each time can be a huge time waste. So, I’m throwing the final product up on GitHub in case others want to fork it and use it as their boilerplate as well. Continue reading

Auto Set Featured Images

Most current WordPress themes support featured images. But, let’s say you’re updating a site that uses a theme built before WordPress 3.0. And let’s say that theme uses a custom meta field to define the featured images. And let’s say there’s over 900 posts on the site. There’s no way you’d want to set all those featured images manually.

I found myself in that situation today- so I wrote a little plugin:

1) It checks if the custom meta field (‘FeaturedImage’) is set, and if so, fetches the attachment id based on the url string. That attachment gets set as the featured image.

2) If the custom meta field is not set, it will use the first attachment image it finds.

The majority of the code was lifted from two places. Gavick posted the code about setting featured images. Philip posted the code about fetching attachment ids from URL strings.

I can’t vouch at all for the quality of this plugin- so I’m just putting it on GitHub in case it can save another developer some time. Or maybe even make it a little better. Pull requests welcome.

Instant Content Plugin

I’ve been working on a new WordPress plugin called Instant Content for Demand Media that allows users to search for, purchase, and import article content directly to a WordPress site. You can think of it as a marketplace for written content that’s accessible directly through WordPress dashboard.

Instant Content is launching with over 50,000 titles available for sale, all written by freelance writers working with Demand Media. The articles are mostly practical “How-To” type content.

demand-media

It’s been an interesting project to work on and I’d like to share some of the ideas behind it, how the code works, and even how the plugin could even be adapted for other purposes. Continue reading