• Resolved nobleknight

    (@nobleknight)


    Hello. I’m using the following code (from GeneratePress staff) to redirect author link, displayed above the posts, to the author page, and it works great.

    The code I’m using through WPCode plugin:

    add_filter( 'author_link', 'my_author_link' );
    function my_author_link() {
    return home_url( 'link-to-my-author-page' );
    }

    But, in addition to that, I want to display on hover the text “Author Page”. For now, it displays the default “View all posts by <the author name>”.

    Could you help me on this?
    I know this is not specific to your theme, but I would be grateful if you can give me a little help.

    Thank you very much.

Viewing 5 replies - 1 through 5 (of 5 total)
  • David

    (@diggeddy)

    Hi there,

    Do you meant the tool tip that appears on hover?

    If so, i would need to see the site, so i can ascertain where the title attribute is.

    Thread Starter nobleknight

    (@nobleknight)

    Thanks David for your response.

    I’m sorry if I can’t provide here my website’s url. If it’s possible, I can do it in private message or through any contact form.

    Otherwise, I’m using:

    • WordPress: 6.4.3
    • GeneratePress theme: 3.4.0

    Thanks.

    David

    (@diggeddy)

    Try this snippet to change the title ( tool tip ):

    add_filter( 'generate_post_author_output', 'custom_author_output_text' );
    function custom_author_output_text( $output ) {
        // Define the replacement string
        $replacement = 'Author Page';
    
        // Search for the original line and replace it with the replacement string
        $output = str_replace(
            esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
            $replacement,
            $output
        );
    
        return $output;
    }
    Thread Starter nobleknight

    (@nobleknight)

    Thank you very much, David.

    The code works perfectly.

    Thanks for all your contributions to the community.

    David

    (@diggeddy)

    Glad to be of help

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change author link hover text’ is closed to new replies.