[Resolved] Change author name link color and underline it in posts

Home Forums Support [Resolved] Change author name link color and underline it in posts

Home Forums Support Change author name link color and underline it in posts

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1611393
    Jorge

    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.

    #1611657
    Ying
    Staff
    Customer Support

    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 πŸ™‚

    #1611837
    Jorge

    Awesome Ying! it works perfectly. Thanks for your help πŸ™‚

    #1612400
    Ying
    Staff
    Customer Support

    No problem Jorge πŸ™‚
    Glad to help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.