[Support request] Customize Link Anchor Text on Homepage

Home Forums Support Customize Link Anchor Text on Homepage

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1489248
    Mario

    Hi, I have a question about doing custom anchor text on the home page.

    This is my site: ideamensch.com/

    Do you have any documentation about how I can change it from ‘Learn from them” to “Learn from post title” which is their first name and last name.

    Thank you in advance.

    #1489276
    Elvin
    Staff
    Customer Support

    Hi,

    The closest related documentation to this is this one:
    https://docs.generatepress.com/article/generate_content_more_link_output/

    This filter changes the read more button output.

    Here’s an example code that does pretty close, if not exactly, what you need.

    add_filter( 'generate_excerpt_more_output','lh_change_read_more' );
    function lh_change_read_more() {
        return sprintf( ' <p class="read-more-container"><a title="%1$s" class="read-more button" href="%2$s">Learn from %3$s</a></p>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) ),
    		the_author( get_the_ID() )
        );
    }

    Here’s how to add PHP codes. -https://docs.generatepress.com/article/adding-php/

    A wise man once said:
    "Have you cleared your cache?"

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