We're merging with GenerateBlocks! Learn more here.

[Resolved] Add Post Title to read more…

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Add Post Title to read more…

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #12435

    I’m working on an accessible site where I can’t have multiple ‘read mores’ on one page. What I need to do is add the title of the post to the read more links, i.e., “Read more First Article”, “Read more Second Article”…

    Is there some PHP I can add to functions.php (or elsewhere) to enable this? Thanks!


    Hi there,

    Give this a shot:

    add_filter( 'wpsp_read_more_output', function( $output, $settings ) {
        return sprintf( '<div class="wpsp-read-more"><a title="%1$s" class="%4$s" href="%2$s">%3$s</a></div>',
            the_title_attribute( 'echo=0' ),
            esc_url( get_permalink() ),
            'Read more ' . get_the_title(),
            esc_attr( $settings['read_more_class'] )
    }, 10, 2 );

    Let me know 🙂


    Yes, it works perfectly — thank you so much for this, Tom! Will definitely make a record for use on future accessible sites.

    Really, really appreciate your willingness to do this.


    Glad I could help! 🙂

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