Home › Forums › Pro Support › Excerpt as title › Reply To: Excerpt as title
June 20, 2020 at 5:40 am
#16757
Participant
Hi Tom,
the result is strange, you can see it here. In the Elementor preview I see the standard H2 title size + ►►► (see screenshot above), on the page I see normal text color white with ►►►.
The arrows are coded because WPSP is not compatible with Polylang for the read more function.
The full code related to WPSP is
//Disable read more tag in wpsp
add_filter( 'wpsp_more_tag', '__return_empty_string' );
//Disable image title on hover in wpsp
add_filter( 'wpsp_image_title', '__return_empty_string' );
// Read more function in WPSP
add_filter( 'wpsp_ellipses', function() {
return sprintf(
'...<a href="%1$s"> ►►►</a>',
get_permalink()
);
} );
add_filter( 'get_the_excerpt', function( $excerpt ) {
if ( has_excerpt( get_the_ID() ) ) {
$excerpt .= sprintf(
'...<a href="%1$s"> ►►►</a>',
get_permalink()
);
}
return $excerpt;
} );
//Use excerpt as title WPSP
add_action( 'wpsp_after_content', function( $settings ) {
if ( 32293 === $settings['list_id'] ) {
echo '<h2>';
the_excerpt();
echo '</h2>';
}
} );