Support Forum

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support Conditional 'Read More' text changes Reply To: Conditional 'Read More' text changes

#15148
Tom
Keymaster

You can use the same filter:

add_filter( 'wpsp_read_more_output', function( $output ) {
    if ( has_tag( 'your-tag' ) ) {
        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() ),
            'YOUR CUSTOM TEXT HERE',
            'wp-show-posts-read-more'
        );
    }

    if ( has_tag( 'another-tag' ) ) {
        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() ),
            'YOUR CUSTOM TEXT HERE',
            'wp-show-posts-read-more'
        );
    }

    return $output;
} );