Site logo

Archived topic

Change author name link color and underline it in posts

3 replies · Started by Jorge on January 8, 2021

Viewing posts 1–4 of 4

Hi there,

I've been trying to change the author name link color and also underline it, but I can't, so I ask, sorry!.

I also want to put "por" instead of "by" (please see image ).

Thanks a lot.

Hi Jorge,

You could use this PHP snippet to change "by" to "por".

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
    if ( 'author' === $item ) {
        return ' por ';
    }
        return $output;
}, 50, 2);

Adding PHP: https://docs.generatepress.com/article/adding-php/

And use this CSS to style the author name.

.single-post span.author.vcard a {
    color: red; /*change to the color code you want*/
    border-bottom: 1px solid red; 
}

Adding CSS: https://docs.generatepress.com/article/adding-css/

Let me know :)

Awesome Ying! it works perfectly. Thanks for your help :)

No problem Jorge :)
Glad to help!

This archived topic is closed to new replies.