Set a fallback image for WordPress Post Thumbnails

I recently wrote this article for Search Engine People, and figured that others may find it useful. It explains how to set a fallback image for WordPress Post Thumbnails.

Intro

One of the countless things that I love about WordPress is how easy and efficient the process of adding new content is. All you have to do is provide the art and copy and your theme will take care of the rest. While this workflow is usually smooth, there are times the end user can miss a step or two. I’ve noticed when working on larger sites with multiple authors one of the most common things to slip through the cracks is setting a featured image. While this shouldn’t break your theme, it can create layout inconsistencies or (shudder) broken images. Lucky for us, we can easily provide a fallback, and I’ll tell you how.

WordPress Post Thumbnails

Post Thumbnails were introduced in WordPress 2.9 [Source: WordPress Codex] and have since become somewhat of a standard for theme developers. If a theme declares support for this functionality, it allows authors to set an image that will represent Posts, Pages, or Custom Post Types. How this image is utilized is completely dependent on the theme. A lot of themes will use a featured image to accompany excerpts, but that’s just one example.

Read the rest of my article over at Search Engine People.