Archived topic
Creating A Code-Based Author Box W/ No Gravatar
1 reply · Started by Marty on June 12, 2022
Hi there, I searched but couldn't find the answer, sorry! This is based on this old thread here: https://generatepress.com/forums/topic/author-box-4/ (RE: PHP snippet author box). *(I don't currently use GenerateBlocks)
1. Instead of Gravatar I'd like to pull the author thumbnail from the existing Wordpress User image or my own image URL perhaps. (Not sure what's best)
2. I don't need to link to the author archives. I assume I can delete that portion in the PHP snippet?
3. How do I have a little link/"Read more »" etc. I can set the URL for below the description text?
Thank you very much!
Hi Marty:
1. Image:
Change this line: <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' )); ?></div>
to <div class="avatar"><img src="your-image-url" alt="alt-text"></div>, replace the your-image-url and alt-text with yours.
2. Remove author archive link:
Remove these lines:
<div class="author-links">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more">
...
</a>
</div>
3. Read more link:
Add this: <a href="your-url" title="Read more">Read more >></a>