Home › Forums › Pro Support › Conditional 'Read More' text changes › Reply To: Conditional 'Read More' text changes
April 28, 2020 at 4:25 pm
#15148
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;
} );