Skip to content
GeneratePress
  • Home
  • Premium
  • Site Library
  • Install
  • Help
    • Documentation
    • Support Forum
    • Contact
  • Log In
GeneratePress
  • Home
  • Premium
  • Site Library
  • Install
  • Help
    • Documentation
    • Support Forum
    • Contact
  • Log In
  • Log In
  • Free Support

[Resolved] Can I change what's shown by {{post_author}} tag?

Home › Forums › Support › Can I change what's shown by {{post_author}} tag?

  • This topic has 3 replies, 2 voices, and was last updated 3 years, 8 months ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • August 10, 2017 at 10:17 am #363241
    Jan

    Hi,

    when I use {{post_author}} tag in Page Header, it shows the_author_meta(‘nickname’) information. Is it possible to change it to the_author_meta(‘display_name’)?

    I tried to create custom shortcode ( https://generatepress.com/forums/topic/single-post-page-header-issues/#post-350710 ) for that purpose, but the returned value is shown right after .inside-content-header element, not in the place I put the shortcode in.

    thanks

    GeneratePress 1.3.48
    GP Premium 1.4.1
    August 10, 2017 at 11:18 am #363317
    Tom
    Lead Developer
    Lead Developer

    Try this instead:

    add_shortcode( 'avatar', 'tu_author_avatar' );
    function tu_author_avatar() {
        ob_start();
        global $post;
        $author_id = $post->post_author;
        get_avatar( $author_id, 32 );
        return ob_get_clean();
    }

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/
    Ongoing Development: https://generatepress.com/ongoing-development

    August 10, 2017 at 12:39 pm #363402
    Jan

    Thank you, Tom. It’s working now. πŸ™‚

    August 11, 2017 at 12:08 am #363687
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    Documentation: http://docs.generatepress.com/
    Adding CSS: http://docs.generatepress.com/article/adding-css/
    Ongoing Development: https://generatepress.com/ongoing-development

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

Common Issues

  • Missing style.css
  • Updating errors
  • Plugin Install Failed

Useful Articles

  • Installing GP Premium
  • Installing GeneratePress
  • How to add CSS
  • How to add PHP

GeneratePress

  • About
  • Premium
  • Site Library
  • Gutenberg
  • Affiliates
  • Reviews
  • Brand Assets
  • Blog
  • We’re Hiring!

Support

  • Documentation
  • Contact Us
  • Support Forums
  • Fastest WordPress Theme
  • Changelogs
  • Legal
  • Donate
  • Translate

Popular FAQs

  • Install GeneratePress
  • Installing GP Premium
  • Missing style.css
  • Plugin Install Failed
  • Adding CSS
  • Adding PHP
  • WordPress Hosting

Social

  • Facebook
  • Twitter
  • WordPress
  • GitHub
Made with on Vancouver Island
  • Home
  • Premium
  • Site Library
  • Install
  • Contact
  • Support Forum
  • Documentation
  • Account
  • Checkout