Archived topic
Author information wont show
5 replies · Started by Matthias on January 29, 2019
Hi i want a Author box below my post, it wont show the description and doesnt show the photo/gravatar i use as an author: I used this for it
But it wont show the author description
Hi there,
Have you solved this?
The topic is marked as resolved.
Hi,
I have the same problem in my web marketing blog https://www.magnetmarketing.it/blog/.
I would like to show an Author informations (name, gravatar, description) box below my post.
Can you help me please?
Hi there,
You can:
1. Add a Hook Element: https://docs.generatepress.com/article/hooks-element-overview/
2. Set the hook to after_content
3. Check the Execute PHP option
4. Add this as the hook content:
<div class="author-box">
<div class="avatar">
<?php echo get_avatar( get_the_author_meta( 'ID' ) ); ?>
</div>
<div class="author-info">
<h5 class="author-title"><?php printf( esc_attr__( 'About %s', 'the author' ), get_the_author_meta( 'display_name') );?></h5>
<div class="author-summary">
<p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
</div>
</div>
</div>
5. Set the Display Rules.
Then, just add this CSS to your site:
.author-box {
padding: 4%;
margin-top: 60px;
font-size: 1em;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
}
Hope this helps :)
Hi Tom,
thanks, it's working!
Is it possible add related posts below the single post too?
Related posts are more complicated. Any chance you can open a new topic and we'll explore those options?