Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1392082
    pjayd
    Participant

    Hi there,

    I used to be able to show the author’s bio at the bottom of each single post. My website is quarterforyourcrisis.com and I’m using the integrity stack with a child theme.

    My blog posts are showing the Author’s name under the title of the post, but I’d like to have the author bio with the picture and link to the other posts written by that author at the bottom of the post.

    Thanks!

    #1392248
    Jade
    Moderator

    Hi there,

    Thanks for writing in!

    If you wish to show the author profile automatically below each single post page, this will require a template change. Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    After that, simply add following code in your child theme’s functions.php file:

    // Author Field below the post content - Single page only.
    // =============================================================================
    
    add_filter( 'the_content', 'custom_author_code');
    
    function custom_author_code($content) {
       if ( is_single() ) {
          return $content . do_shortcode('[author title="About the Author"]');
       } else {
          return $content;
       }
    }
    

    Hope this helps. 🙂

    Thank you.

    #1392267
    pjayd
    Participant

    Hi Jade! This works great, thank you. As a quick follow up question, is there a way to have a “read more from this author” link in that section or in the bio?

    Thanks!

    #1392860
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating in! To have a “read more from this author” link in that section or in the bio, please have the code updated and make use of this code instead:

    // Author Field below the post content - Single page only.
    // =============================================================================
    
    add_filter( 'the_content', 'custom_author_code');
    
    function custom_author_code($content) {
       if ( is_single() ) {
          $readmore = '<p><a href="' . get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ) . '">Read more from this author</a><p>';
          return $content . do_shortcode('[author title="About the Author"]') . $readmore;
       } else {
          return $content;
       }
    }

    We would loved to know if this has work for you. Thank you.

    #1408062
    pjayd
    Participant

    This worked great thank you!

    #1408212
    Thai
    Moderator

    You’re most welcome 🙂

  • <script> jQuery(function($){ $("#no-reply-1392082 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>