• Resolved icco

    (@icco)


    I recently started using gravatar, and im wondering if anyone knows a way to make it so you can have an icon next to the post to show who posted it.

Viewing 15 replies - 16 through 30 (of 35 total)
  • Thread Starter icco

    (@icco)

    oi. now how do i get that blank gravat gone and replace it with the right one?

    Thread Starter icco

    (@icco)

    bump

    Thread Starter icco

    (@icco)

    i found the bug in your php. its amazingly simple πŸ™‚

    you need to put this wherever you want your image

    <?php $grav_email=$authordata->user_email; $grav_url = “http://www.gravatar.com/avatar.php?gravatar_id=&#8221;.md5($grav_email).”&default=”.urlencode($default).”&size=40″; echo “<img src=\”$grav_url\” alt=\”gravatar\”/>” ; ?>

    notice the size. you just needed to put a number inside the quotes and it works perfectly πŸ™‚

    thanks for the help.

    This post is a little old, but I altered the code on the Gravatar plugin on the Gravatar site to work for post authors. You can visit http://blog.jamiephelps.com/postgravatar/ for this plugin.

    I hesitate to say it’s my plugin. I generally just alter other plugins’ code for another purpose with very little alteration. If that counts, then this is my second plugin. If not, then I’m a schmuck.

    Godspeed,

    Thread Starter icco

    (@icco)

    thats cool, it works too. but just to tell you youve got a few bugs in your comment system πŸ™‚

    Well, once again, I’ve come across a plug-in that fails to tell you where the code actually goes. πŸ™ After reading this thread I can say I’m only a little bit closer.

    If I understand correctly the

    <?php gravatar("R", 40); ?>

    needs to go in an img tag and somewhere within the loop in index.php. Am I right so far? If so, I’m thinking there’s an appropriate spot for the code to be placed in there, so where might that be?

    Assuming I am correct, that means that that information is then carried over to the comments page when someone clicks on “comments”. So, I know I need a class for gravatar in my stylesheet (which I’ve added), but what I don’t understand is where on the comments page do I tell it “put it right here”.

    Here’s my test blog.

    ???

    bump

    No one told me either. People aren’t exactly helpful here.

    It doesn’t go on your index page, it goes in your wp-comments page

    try this:

    File – wp-comments.php:

    There is a line that says, <!– You can start editing here. –>.

    In the second group of code which starts: < ?php if ($comments) { ?>, add the gravatar code just after <?php _e(“by”); ?> , that way the photo comes up next to the name of the commenter.

    Hope that works

    You can see it in action here:

    http://www.pendasrealm.com/diner/index.php?p=630

    Thanks, Penda! I’ll give it a try. πŸ™‚

    Ohmygosh, Penda, it worked! I made a few modifications to the instructions you provided, but you at least got me in the right place to make the change.

    Thanks!

    Thread Starter icco

    (@icco)

    sorry i didnt respond sooner guys, ive been busy. im not sure whether you are asking about the plugin or the php code, if you want help you need to be specific.

    Gee icco – the questions were about as specific as they come – “where does the plugin go”. We’re not asking for you to hold our hands, I mean, we did install the dang things, just clearer instructions.

    And David – I’m glad it worked out for you.

    Well, that isn’t exactly specific. “Where does the plugin go?” could mean where do I put the plugin file or where do I insert the php code to call the plugin in the template.

    That all being said, the gravatar php code needs to go in an image tag in the comments template (location differs pending your version of WP) inside the comment loop. The plugin I posted about is for the post loop. That’s why there has to be a different plugin for post gravatars vs. comment gravatars.

    @icco – What problems do you see with my comment system?

    jxpx777 were able to fix the problems within your plugin that icco suggests might be there?

    I’d like to use this plugin for post authors on a review site, which would be very useful. However, I may end up using a local image for each author called by the plugin – is this possible with your plugin or will I have to go to the php route?

    @icco could you advise on how and where you implemented the code?

    Btw, I’m not talking about having a gravatar on a comments area, that I have, just that when a user makes a post it says by: username and then their gravatar/avatar/smhavatar

    Cheers

    There is a plugin on the wp-plugins.net database that is for “official comments” that will allow formatting for whenever you are logged in and post a comment. I’m sure it could be modified to do what you are looking to do. My modification of the gravatar plugin is working fine on my site, but perhaps I haven’t run into icco’s referenced problem. Often times, I do not alter the id material at the top since I am using it for myself, so perhaps that is the problem, i.e. that it looks just like the gravatar plugin in the plugins list in wp-admin. I haven’t had any problems with it. OT, but I have gotta change my gravatar lest people begin thinking I’m a girl and dressing like a Mac nerd version of Lara Croft.

Viewing 15 replies - 16 through 30 (of 35 total)
  • The topic ‘Gravatar as poster’ is closed to new replies.