• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Positioning an author gravatar near a post title

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

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

This topic is: not resolved

Tagged: gravatar, gravatar positioning

  • This topic has 22 replies, 5 voices, and was last updated 12 years, 6 months ago by lliillaa.
Viewing 20 posts - 1 through 20 (of 23 total)
1 2 →
  • Author
    Posts
  • November 27, 2012 at 8:16 am #1832
    Mike
    Member

    I have a number of clients who routinely request to have their (or one of their authors) gravatar positioned beside (or near) the post title on a single post page?  Also, how would I include it in a category archive page which displays a list of 5 articles with snippets?

    What is the easiest way to do this?  Thanks All!

    November 27, 2012 at 9:45 am #1849
    SoZo
    Member

    If you aren't familiar with functions and would rather not edit functions.php then you could use Genesis Simple Hooks and add it to the before_post_title hook


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    November 27, 2012 at 10:01 am #1860
    Mike
    Member

    I wouldn't have a problem editing the functions.php file.  Can you provide the code?

    Thanks SoZo!

    November 27, 2012 at 10:32 am #1872
    SoZo
    Member

    What code are you referring to?


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    November 27, 2012 at 10:35 am #1874
    Mike
    Member

    If its not code, then the edits required to the functions.php file you mentioned to enable the functionality I describe.

    November 27, 2012 at 10:37 am #1876
    SoZo
    Member

    Adding a function would go something like
    add_action('genesis_before_post_title', 'your_function');
    function your_function() {
    STUFF YOU WANT THE FUNCTION TO OUTPUT
    }


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    November 27, 2012 at 10:47 am #1878
    Mike
    Member

    Ok, I'm not a programmer so I can't decipher this.  Let's try the other avenue.  What would I need to add to the before_post_title hook to get the functionality I'm looking for?

    November 27, 2012 at 11:50 am #1888
    SoZo
    Member

    I don't have that code memorized. I imagine a google search would bring it up though.


    John “Nicolas Flamel” Wright | SoZo’s design| John Wright Photography

    December 8, 2012 at 11:35 am #3861
    Debs
    Participant

    I don’t have that code memorized. I imagine a google search would bring it up though.

    oh dear...not helpful...and just a tad sarcastic methinks... most people come here when they can't find answers on google...!

    this might help from the old forum! Add Gravatar to Post Title [Tutorial]

     

    December 9, 2012 at 1:14 pm #4019
    Mike
    Member

    Debs,

    Maybe this will help.  It's from Nick in reponse to my email inquiring as to how much support I should expect or not expect as the case may be as a Pro-Plus member.  This was prompted by this ticket.

    Take it for what it is.

    Best Regards,

    Mike

    *****

    Mike,

    We can help with usage and technical support in help desk. We have always relied on forum support for customizations. This allows the community to help and benefit.

    To help get you started with the info John gave you, use get_avatar()
    http://codex.wordpress.org/Function_Reference/get_avatar

    Nick

    December 9, 2012 at 1:25 pm #4021
    Mike
    Member

    Oh and thanks Debs!  I didn't see your link at the bottom.  I came up with a different solution so all is good.  Thanks again!

    - Mike

    December 9, 2012 at 1:28 pm #4022
    Debs
    Participant

    hi mike - glad you got that sorted!

     

    December 9, 2012 at 1:32 pm #4023
    Debs
    Participant

    actually mike...could you share what you did here? thanks!

    December 9, 2012 at 1:48 pm #4025
    Mike
    Member

    Sure.

    I did what SoZo suggested and googled "Using Gravatars in WordPress" and came across Bill Richardson's blog, a well respected developer in both Genesis and Thesis.  Bill had an article on this at http://www.billerickson.net/using-gravatars-in-wordpress/

    I kinda took the long way around but Bill made it easy to understand and since Thesis has recently released version 2, I bought the developer version.  It is a lot different than Genesis but extremely powerful for the person like me who is not a novice but isn't a full-fledged developer either.  I like owning both Genesis & Thesis as each framework has its strengths and weaknesses.  Another tool in the toolset.

    All that said, my client was more than happy so all ended well.

    Best Regards,

    Mike

    December 10, 2012 at 4:04 am #4132
    Debs
    Participant

    thanks mike, that's helpful...i've been a thesis user for many years and have only recently joined the genesis community...

    December 10, 2012 at 8:40 am #4160
    Mike
    Member

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

    December 30, 2012 at 5:42 pm #8477
    lliillaa
    Member

    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?

    December 30, 2012 at 5:54 pm #8480
    Susan
    Moderator

    @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]

    December 31, 2012 at 8:37 am #8592
    Mike
    Member

    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.

    December 31, 2012 at 10:35 am #8601
    lliillaa
    Member

    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?

  • Author
    Posts
Viewing 20 posts - 1 through 20 (of 23 total)
1 2 →
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble