Tagged: x
-
AuthorPosts
-
March 2, 2017 at 10:59 am #1392082
pjaydParticipantHi 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!
March 2, 2017 at 1:09 pm #1392248
JadeModeratorHi 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.
March 2, 2017 at 1:20 pm #1392267
pjaydParticipantHi 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!
March 2, 2017 at 9:55 pm #1392860
Rue NelModeratorHello 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.
March 15, 2017 at 9:47 am #1408062
pjaydParticipantThis worked great thank you!
March 15, 2017 at 11:04 am #1408212
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1392082 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
