Positioning an author gravatar near a post title

Community Forums Forums Design Tips and Tricks Positioning an author gravatar near a post title

This topic is: not resolved

This topic contains 22 replies, has 5 voices, and was last updated by  lliillaa 1 year, 10 months ago.

Viewing 8 posts - 16 through 23 (of 23 total)
  • Author
    Posts
  • #4160

    Mike
    Participant
    Post count: 4

    Cool.  So I’m not telling you anything new.  Thanks again for your guidance.  It is much appreciated.

    #8477

    lliillaa
    Participant
    Post count: 19

    I really want to do this. Area you saying the only way you could figure it out is to buy and use Thesis instead of Genesis. I’m pretty new at WordPress and need a little more assistance. Is this possible to do?

    #8480

    Susan
    Moderator
    Post count: 9426

    @lliillaa

    Debs linked to a tutorial, but you may not have access to it, so I’ve taken the liberty of including this here:

    http://www.studiopress.com/support/showthread.php?t=82871&highlight=author+gravatar+post+title

    From user AnoopSudhakaran on the old forum

    Paste the following code in functions.php of your Child Theme to enable the Gravatar in the Post Title on all pages (Single Post,Homepage etc.):

    Note: Change the 25 to the size of Gravatar you want.

     

    function title_avatars() { ?>
    <div id=”avatar-title”>
    <?php echo get_avatar( get_the_author_id() , 25 ); ?>
    </div>
    <?php }
    add_action(‘genesis_post_title’, ‘title_avatars’);

    If you would like to add it only on the Homepage then use this code:

    function title_avatars() {
    if (is_home())
    { ?>
    <div id=”avatar-title”>
    <?php echo get_avatar( get_the_author_id() , 25 ); ?>
    </div>
    <?php } }
    add_action(‘genesis_post_title’, ‘title_avatars’);

    If you want to get Gravatar only on Single Pages:

    function title_avatars() {
    if (is_single())
    { ?>
    <div id=”avatar-title”>
    <?php echo get_avatar( get_the_author_id() , 25 ); ?>
    </div>
    <?php } }
    add_action(‘genesis_post_title’, ‘title_avatars’);

    Style it using CSS

    #avatar-title {CSS HERE} [Tip : Use Firebug to edit in realtime]


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #8592

    Mike
    Participant
    Post count: 4

    Thank you for the follow up on this topic Susan.  It is much appreciated and very helpful for any future projects that may require Genesis.

    #8601

    lliillaa
    Participant
    Post count: 19

    Thank you for copying and pasting the information, but just to be certain, I actually manually add this to the bottom of the functions.php file of the child theme even though it states at the top of the file not to make changes to it under any circumstances? I can’t add it using the Custom Code portion of the Genesis settings?

    #8602

    lliillaa
    Participant
    Post count: 19

    Oops, one more thing. I don’t understand the “style it using CSS. Where do I put that code?

    #8616

    Susan
    Moderator
    Post count: 9426

    lliillaa – do you have the Prose theme? That’s the only theme where you wouldn’t plug it directly into your functions file – that theme is set up differently than the other themes.


    Susan @ Graphically Designing I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

    #8617

    lliillaa
    Participant
    Post count: 19

    Yes, I have the Prose theme.

Viewing 8 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic.