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.
Display Author Gravatar in the Loop
If you want to display an author’s Gravatar, this little code should do the trick (note that it only works inside the Loop):
The second parameter dictates the size of the avatar. More about
get_avatar().