Tag Archive | "Wordpress"

Tags: Wordpress

Add Author’s Gravatars to Posts in Wordpress

Posted on 02 August 2009 by Raman

Add Author's Gravatars to Posts in Wordpress

Adding Gravatar to your blog, makes your blog’s comments look more attractive. That’s why it have been incorporated in the Wordpress core.

Now comes the idea of adding your gravatar to your post on Wordpress. This can be pretty useful in blogs with multiple authors, so that readers can quickly identify, who wrote this post.

And adding this feature is real easy. Just add this code in your single.php -

<?php echo get_avatar( get_the_author_email(), ‘80′ ); ?>

You have to add this, where you want to display the Author’s gravatar. In this code “80″ is the size of the gravatar, you can change it to any value you want.

Pretty simple!! huh :)

If you enjoyed this post, make sure you subscribe to my RSS feed!

Comments (1)

Tags: Wordpress

Add Latest Registered Users list in your sidebar.

Posted on 13 June 2009 by Raman

Add Latest Registered Users list in your sidebar

If you are getting a lot of user registrations and want to flaunt it, then what else can be the best than show your “Latest User Registeres” list in your sidebar.

What you have to do is just paste the following code to your sidebar -

<h2>Latest registered users</h2>
<ul>
<?php
$usernames = $wpdb->get_results(”SELECT user_nicename, user_url FROM $wpdb->users ORDER BY ID DESC LIMIT 5“);

foreach ($usernames as $username) {
echo ‘<li><a href=”‘.$username->user_url.’”>’.$username->user_nicename.”</a></li>”;
}
?>

</ul>

This will display a list of latest 5 registered users in your sidebart along with the url.

You can change the number of users in list by simply changing the number 5 (in red) in above code.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Comments (0)

Affiliate Theme Advertise Here
Advertise Here