[Resolved] Customizing the Excerpts Read More

Home Forums Support [Resolved] Customizing the Excerpts Read More

Home Forums Support Customizing the Excerpts Read More

  • This topic has 3 replies, 2 voices, and was last updated 5 years ago by Tom.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #850859
    Robert

    I’d like to change my excerpts Read more link to Read: “Post Title”.

    #851574
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Try this:

    add_filter( 'generate_excerpt_more_output', function() {
        return sprintf( ' ... <a title="%1$s" class="read-more" href="%2$s">Read: %3$s</a>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink( get_the_ID() ) ),
            get_the_title()
        );
    } );

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

    #852356
    Robert

    Awesome

    #852630
    Tom
    Lead Developer
    Lead Developer

    Glad I could help 🙂

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