Gravatar WordPress Comments

Today I searched gravatar wordpress comments trying to figure how to get the gravatar images next to the comments in a wordpress.org theme. I was surprised to find that wordpress natively supports gravatars in 2.5 and above. To use it you just call get_avatar and pass in the email and an optional size and it spits out the image html. Once I found the loop of comments in the template code, I just added the below code in a div next to the comment text.

I used comment_author_email on the php comment object to get the email address of the person who made the comment. It was pretty painless to do and a great feature to add to my template.

WordPress SEF Urls Permalinks

Today I Search WordPress SEF urls to make my urls look “pretty” and all of the articles pointed to a wordpress setting called Permalink.

So of course I want to do a custom structure and was looking for what parameters needs to be passed. Right on that page there was a link to WordPress Permalinks. It has everything I was looking for including this bit of good information,

For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields… So, it is best to start your permalink structure with a numeric field, such as the year or post ID.

So i decided to go the the structer of: /%post_id%/%category%/%postname%.html

Go back to top