• 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

Display ? gravatar in entry meta post info

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 › Display ? gravatar in entry meta post info

This topic is: resolved

Tagged: .post-info, entry-header, gravatar

  • This topic has 4 replies, 2 voices, and was last updated 5 years, 10 months ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • July 14, 2017 at 5:48 am #209098
    Matus
    Member

    I'd like to display gravatar next to author's name in entry meta above posts.
    I'm using Genesis Simple Edits plugin for customization entry metas.
    But it seems there is no shortcode for displaying author's gravatar.

    Here's an article showing what I'd like to achieve.

    I followed this tutorial, but from some reason, I didn't get to manage the gravatar to show.
    Maybe there's a conflict when using Genesis Simple Edits plugin.

    I'll appreciate any help.

    July 14, 2017 at 5:58 am #209099
    Brad Dalton
    Participant

    Hi

    Which code snippet are you using?


    Tutorials for StudioPress Themes & WooCommerce.

    July 14, 2017 at 7:03 am #209103
    Matus
    Member

    I'm using the first code snippet.

    I forgot to add a CSS code which caused gravatar wasn't visible.
    Now I fixed it.

    If I may, I'd like to ask you a question.
    What will be the code if I wanted it to be in format "Wrote by Gravatar, Author name, on Date" (without commas)?

    July 14, 2017 at 7:26 am #209105
    Matus
    Member

    This is the code I thought will be right, but I got an error.

    add_action('genesis_entry_header', 'wpsites_single_post_author_avatars');
    function wpsites_single_post_author_avatars() {
    if ( ! is_singular( 'post' ) & ! is_category('') & ! is_home() ) return;
    	?>
    		<?php
    			printf('<p>%1$s</p>',
    			__('Wrote by ')
    			)
      		echo get_avatar(get_the_author_meta('email'), 30);
    			printf('<p>%1$s</p>',
    		?>
    	<?php
    }
    July 14, 2017 at 6:37 pm #209122
    Brad Dalton
    Participant

    Please start a new topic for a new question. This code may help

    Looks like you closed the PHP tag before printf which needs PHP


    Tutorials for StudioPress Themes & WooCommerce.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • 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

© 2023 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