[Resolved] Adding Bio to author page and adjustments

Home Forums Support [Resolved] Adding Bio to author page and adjustments

Home Forums Support Adding Bio to author page and adjustments

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1428909
    Dominic

    Hi,

    I’m a bit lost here.

    – How do I add the user bio above the blog content?

    What shortcode do I use to do this and what element should I add?
    Got this already running form all archives

    2020-09-02_18-05-45
    2020-09-02_18-06-11

    – How can I get rid of the “nothing to be found” message when the author has no posts yet (we still want to display the bio

    – Where can I set the hero image for each individual author page?

    thank you for the help

    #1429130
    David
    Staff
    Customer Support

    Hi there,

    Add this PHP Snippet to your site:

    add_shortcode( 'author_bio', function() {
        ob_start();
    
        echo wp_kses( get_the_author_meta( 'description' ), null );
    
        return ob_get_clean();
    } );

    https://docs.generatepress.com/article/adding-php/

    Then you can add this shortcode: [author_bio]

    WordPress doesn’t support featured images for users.
    You would have to use CSS to set each authors hero background like so:

    .author-dominic-heselmans .page-hero {
        background-image: url('url_for_author/image.jpg');
    }
    #1435037
    Dominic

    Hi David,

    Thank you very much for the feedback.

    I’m not 100% sure where to add the shortcode [author_bio] ?

    #1435543
    Leo
    Staff
    Customer Support

    If you want it to show above the blog post content then generate_before_content should work:
    https://docs.generatepress.com/article/hooks-visual-guide/#single-post

    Let me know 🙂

    #1436350
    Dominic

    thank you 🙂

    #1436902
    Leo
    Staff
    Customer Support

    No problem 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.