Site logo

Archived topic

Cannot link to author page from bio box

1 reply · Started by Kiva on January 10, 2023

Viewing posts 1–2 of 2

I'm using the following hook for a bio box, but when you click on the link to get to the author's posts (in the author-links div) it just takes you to the home page, not the author's posts. How do I change it to go to the author's posts? Also, how do I change the font size on the text displayed for the link (where it is currently showing ...) as it is really large now. thanks

----

<?php echo get_avatar( get_the_author_meta( 'ID' ), 250 ); ?>
<h5 class="author-title" itemprop="author" itemscope itemtype="http://schema.org/Person">
<span itemprop="name"><?php printf( get_the_author_meta( 'display_name') );?></span>
</h5>

<p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>

Hi Kiva,

There's no href attribute in your <a> tag. You need to add something like this to retrieve the author archive page link: https://developer.wordpress.org/reference/functions/get_author_posts_url/

You'll need custom CSS to change the font-size. You can also use the Typography module: https://docs.generatepress.com/article/dynamic-typography-overview/

Alternatively, you can use a Block Element instead: https://www.youtube.com/watch?v=4x6CjGOyagc

Using a Block Element is what we would suggest.

This archived topic is closed to new replies.