StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   How to display gravatar to the left of the post title? (http://www.studiopress.com/support/showthread.php?t=5963)

jchen127127 03-06-2009 08:26 AM

How to display gravatar to the left of the post title?
 
I'm running a multi-user site so I'd like each author's gravatar to appear next to the post title, same as Mashable.com does. Currently the gravatar shows up in the actual post.

According to this link: http://themeshaper.com/how-to-add-grava ... wordpress/, this line should be inserted somewhere in the code, <?php echo get_avatar( get_the_author_email(), '80' ); ?>.

Thanks in advance!

Rebecca Diamond 03-06-2009 08:42 AM

Re: How to display gravatar to the left of the post title?
 
you post it in the single.php or index.php in the div "postauthor", and you'd want to post it after the "h1" tag. It may take some playing in CSS to get it to display properly.

jchen127127 03-07-2009 07:51 AM

Re: How to display gravatar to the left of the post title?
 
The code you are referring to looks like this in my index.php (there's no single.php, or the )

<div class="postauthor">

I put the code here ---> <?php echo get_avatar( get_the_author_email(), '80' ); ?>



Posted by <?php the_author_posts_link(); ?> on <?php the_time('l, F j, Y'); ?> &middot; <?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?><?php edit_post_link('(Edit)', '', ''); ?></p>

then tried it here ----> <?php echo get_avatar( get_the_author_email(), '80' ); ?>
</div>

I even tried putting it above the postauthor div, but nothing happened. Am I missing something?

Thanks in advance

Debra 03-07-2009 09:20 AM

Re: How to display gravatar to the left of the post title?
 
try this

Code:

<h1><?php echo get_avatar( get_the_author_email(), '80' ); ?> <?php the_title(); ?></h1>

jchen127127 03-10-2009 10:06 PM

Re: How to display gravatar to the left of the post title?
 
Sorry, still not working...

Debra 03-10-2009 10:09 PM

Re: How to display gravatar to the left of the post title?
 
Works for me on a test site so I don't know what to tell you.

Do you have a gravatar?

Do you have gravatars enabled under settings =discussion

jchen127127 03-10-2009 11:43 PM

Re: How to display gravatar to the left of the post title?
 
Do you have a gravatar?
yes, they work fine, they appear in the comments. The point was I wanted them aligned next to the title, rather than in the body of the post.

See here: http://www.odysseylc.com/2009/02/26/dif ... /#comments

Do you have gravatars enabled under settings =discussion
yes.

Just to double-check, the codes now appear as
" <div class="postauthor">

<h1><?php echo get_avatar( get_the_author_email(), '80' ); ?> <?php the_title(); ?></h1>



Posted by <?php the_author_posts_link(); ?> on <?php the_time('l, F j, Y'); ?> &middot; <?php comments_number('Leave a Comment', '1 Comment', '% Comments'); ?><?php edit_post_link('(Edit)', '', ''); ?></p
</div>"
in the index.php file under /wp-content/theme/corporate/

Thanks!


All times are GMT -5. The time now is 02:21 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.