• 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

How to display the profile picture on the homepage

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 › General Discussion › How to display the profile picture on the homepage

This topic is: resolved

Tagged: author archive, author avatar

  • This topic has 6 replies, 2 voices, and was last updated 9 years, 4 months ago by riseUp.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • March 1, 2016 at 10:47 pm #180404
    riseUp
    Member

    Hello,

    Does anybody know how to display the profile picture/avatar for each post on the homepage? I am noticing that it does not show on the homepage for each post. However, when you click on a post, you can see the profile picture/avatar.

    Please excuse the messiness of the homepage as I am doing some trial and error on the whole Genesis structure. Thanks.

    http://www.ymphony.com
    March 2, 2016 at 4:03 am #180416
    Brad Dalton
    Participant

    Are you referring to this post? http://www.studiopress.community/topic/how-to-display-author-photo-next-to-the-post-on-the-homepage/


    Tutorials for StudioPress Themes.

    March 3, 2016 at 8:29 pm #180601
    riseUp
    Member

    That's right. I'm still trying to figure this one out.

    I am using the following code to display the avatar on the homepage for each post:

    function wpsites_post_author_avatars() {
    echo get_avatar(get_the_author_meta('email'), 300);
    }

    The above code allows me to show the avatar on the homepage for each post. However, I can't seem to display the avatar above the title and centered based upon the following:

    add_action( 'genesis_entry_header', 'bg_entry_gravatar', 7 );
    function bg_entry_gravatar() {
    if ( is_singular( 'post' ) ) {
    echo '<div class="entry-avatar">';
    echo get_avatar( get_the_author_meta( 'user_email' ), 240 );
    echo '</div>';
    }
    }

    So, I attempted to "merge" the BG code into your code, but with no success. What do you think?

    March 4, 2016 at 3:51 am #180628
    Brad Dalton
    Participant

    Here's a few things you can try:

    1. You could change the hook to

    genesis_before_entry

    or

    2. Change the 3rd parameter to 1

    or

    3. Filter the entry title

    or

    4. Use CSS to position the image before the entry title

    Another option is to look for a theme which already includes the avatar before the title and see how its done.


    Tutorials for StudioPress Themes.

    March 4, 2016 at 6:18 am #180639
    riseUp
    Member

    Hi.

    I was able to place the avatar above the title which is great. I was able to tweak your code as the following:

    function wpsites_post_author_avatars() {
    echo get_avatar(get_the_author_meta('email'), 300);
    }

    add_action('genesis_entry_header', 'wpsites_post_author_avatars', 7);

    I added a "7" to the their area of add_action.

    How would I be able to "center" the image? The CSS code that I have is:

    .entry-header .avatar {
    border: 5px solid #f5f5f5;
    border-radius: 50%;
    float: none;
    height: 120px;
    margin-bottom: 20px;
    text-align: center;
    width: 120px;

    I tried tinkering with the text-align: center here and there but with no avail. Thanks.

    March 4, 2016 at 7:01 am #180642
    Brad Dalton
    Participant

    Try this http://www.w3schools.com/tags/att_img_align.asp


    Tutorials for StudioPress Themes.

    March 4, 2016 at 7:56 pm #180679
    riseUp
    Member

    That worked. Thank you!

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ 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