It is common for themes and/or plugins to include default links at the end of the excerpt. These links are set using the excerpt_more filter and can be removed using that same filter.
You can remove these links across the board by adding something like this to your active theme’s functions.php file:
remove_all_filters('excerpt_more');
The problem with this is that it will remove these links in other places in your theme as well and may impact your SEO. I would recommend something more granular, such as removing them just for our slider:
if( get_post_type() == 'ps_promotion' ){
remove_all_filters('excerpt_more');
}
I had the same issue with the excerpts still showing after being disabled. The CSS-only solution I used is adding “display:none” to the “.promo_slider_excerpt a” selector in slide.css.
A benefit of using CSS is that particular pages may be targeted for hiding or showing the excerpt links in the slider.
Hi,
If i want to remove the link continue reading just from the slider, can i add the code
if( get_post_type() == ‘ps_promotion’ ){
remove_all_filters(‘excerpt_more’);
}
to anywhere in functions.php for twentyeleven?
You will need to at least do it within a hook. Init should work:
add_action( 'init', 'remove_excerpt_from_slider' );
function remove_excerpt_from_slider() {
if( 'ps_promotion' == get_post_type() ) {
remove_all_filters( 'excerpt_more' );
}
}
Thank you for your assistance:
And then i place this at the bottom of the functions.php
Regards