WordPress Images ~ The Right Way

WordPress Images - the right way
September 14th, 2011
|

Using images in WordPress has developed rapidly in recent times with the introduction of native thumbnail support as well as the ability to use images in the header and background images of your theme. You also may or may not know that WordPress has support for image galleries built in. As such, before you go install all kinds of plugins to support these various features, take some time to research what is already available in terms of using images in WordPress. 

Post Thumbnails

Post thumbnails were introduced in version 2.9. And where better to get information on how to use them, but straight from WordPress core developer Mark Jaquith. Read his blog post on using Post Thumbnails here:

http://markjaquith.wordpress.com/2009/12/23/new-in-wordpress-2-9-post-thumbnail-images/ 

Mark also mentions how to setup up multiple image sizes in WordPress.

WordPress guru Justin Tadlock also has a comprehensive overview of using this feature in his post at: 

http://justintadlock.com/archives/2009/11/16/everything-you-need-to-know-about-wordpress-2-9s-post-image-feature

Image Galleries

Another popular feature in WordPress sites are image galleries. Now, there are plenty of image gallery plugins and scripts out there, however you will be well served to first investigate what options WordPress offers for image galleries natively. Once again, we have a great blog post by WordPress core developer Otto where he describes how image galleries are supported in WordPress. See the blog post here:

http://ottopress.com/2011/photo-gallery-primer/

Additional Image Sizes

Mark and Otto both touched ont he subject of image sizes, however, for good measure, WordPress Beginner recently released an article on the image sizes specifically. You can find it here:

http://www.wpbeginner.com/wp-tutorials/how-to-create-additional-image-sizes-in-wordpress/

Custom Header Images:

You may also include support for custom header images in your themes, similar to those in use on the default TwentyEleven theme. Again, WordPress Beginner provides a useful overview of the feature in their blog post at: 

http://www.wpbeginner.com/wp-themes/how-to-enable-custom-header-images-panel-in-wordpress-3-0/

Custom Backgrounds:

And last, but not least WordPress 3.0 introduced the ability to support custom background variations such as colours or images from the theme settings. In order to activate this feature and support it in your theme add the following code to your functions.php file:

add_custom_background();

There you have it! 4 solid resources on how to work with images in your WordPress themes. So before you go and install a bunch of plugins, make sure you do your homework beforehand! 

Codex:

As always, if you are in doubt, remember to consult the WordPress Codex to get the nitty gritty straight from the horses mouth:

http://codex.wordpress.org/Using_Images

http://codex.wordpress.org/Using_Image_and_File_Attachments

http://codex.wordpress.org/Post_Thumbnails

Comments are closed.