If you want to display an author’s Gravatar, this little code should do the trick (note that it only works inside the Loop):
<?php echo get_avatar( get_the_author_meta('user_email'), 48 ); ?>
The second parameter dictates the size of the avatar. More about get_avatar().
I’ve been using this Tutplus tutorial to create custom post types, especially the part about creating custom post input. It works nicely, except for the fact that the meta values entered with that input can get deleted completely by WordPress when it autosaves a post. Or if you Quick Edit a post.
It seems to be a WordPress bug Fortunately, someone posted a fix on the comment area. It’s pretty self-explanatory.
There’s also a Trac ticket discussing it, there you can find a more correct fix involving the use of nonces.
In Settings > Media, you are able to set only the height or width of the Thumbnail images and WordPress will resize them proportionally (i.e.: if you have a fixed height, then the widths will vary depending on your uploaded image dimension, and vice versa).
Inside the loop, you can get a thumbnail’s width, height and URL using this code:
$imgdata = wp_get_attachment_image_src( get_post_thumbnail_id(), 'thumbnail' );
$imgurl = $imgdata[0]; // the url of the thumbnail picture
$imgwidth = $imgdata[1]; // thumbnail's width
$imgheight = $imgdata[2]; // thumbnail's height
For the second parameter of the wp_get_attachment_image_src function you can also use ‘medium’, ‘large’ and ‘full’. They correspond to the dimension for the other sizes in Settings > Media.
Read more about the wp_get_attachment_image_src function.
These are some of the best, currently available resources on the various WordPress 3.0 features relevant to theme development. I’ve been using and growing this list personally for a while as a sort of launchpad and they should be enough for most development needs.
There are plenty other resources, tutorials, and tips out there that I do not include here, though. For that, Google is your friend.
Menu
Custom Post Types
Custom Taxonomies
Multisite
Custom Header and Background
Editor Styles
New Theme Template Files
Miscellanea
Just tweeted this:
Doing it right: #genesiswp ‘s theme options UI mimics WP’s look instead of having its own fancy UI.

A lot of you must have seen how various WordPress themes have different theme options UI design. Most of them opt for pretty looking options page with labels, inputs, buttons, icons, and forms that look wildly different from the rest of the Dashboard.
If your theme is like that, you’re doing it wrong.
Huh? Why?
This is a short tutorial on integrating Masonry, the jQuery layout plugin, with your WordPress site. We will try to use that jQuery plugin to show a list of posts in a neatly stacked layout, similar to the one I have down here. Here’s an explanation about Masonry, from it’s home page:
Think of it as the flip side of CSS floats. Whereas floating arranges elements horizontally then vertically, Masonry arranges elements vertically then horizontally according to a grid. The result minimizes vertical gaps between elements of varying height, just like a mason fitting stones in a wall.
Here’s a visual explanation, which I took and edited to fit my layout. Pay attention to the numbers, which shows the order of the elements in your HTML code:

Read the rest of this tutorial→
A quick post to show what I just discovered. Recently I had a case where I needed to show a static coming soon page for non logged-in visitors, but had to show the fully working theme to admin users because the development was done live.
A little Googling got me to this WordPress Maintenance Mode Without a Plugin tutorial by Sivel. It’s a three parts, real quick tutorial that allows for:
- Maintenance mode both for a certain or indefinite duration.
- Style-able maintenance mode notification page.
- Show normal blog to logged-in users.
- Easily turned-off maintenance mode, since you just add a few files to the WordPress installation and can delete those when you’re done.
Another neat things is that it is done using a maintenance mode mechanism already built-in in WordPress (didn’t know it has that). It works just as expected and when the development is done I can remove the files (only two of them) and everything will be back to normal.
Additionally, another simple way to do this is to serve/create a different, maintenance style theme for non-logged in visitors. User Theme is a plugin that allows for that, but I have yet to test how it works.
I’m sure this is a pretty common situation, so how do you guys do it?