Home › Forums › Lite Version › removing […] from posts without content
- This topic has 3 replies, 2 voices, and was last updated 5 years, 6 months ago by
Masonry Guy.
Viewing 4 posts - 1 through 4 (of 4 total)
- AuthorPosts
Erin
GuestHello, I saw the other post about how to hide the excerpt from appearing. I added the code you provided to remove the excerpt but now […] is appearing after the post title. Is there any way to remove this? Thank you in advance.
Masonry Guy
KeymasterHi Erin,
Can you please send me your site url ?
Thanks
Oliver Ishmael
GuestHello Masonry Guy,
Love your plugin.
I am also having the same problem as the above poster. Please can you tell me how to remove the […] from posts where the excerpt has been set to 0:
add_filter('excerpt_length', 'my_excerpt_length'); function my_excerpt_length($length) { if (is_tag()) { return 100; } else { return 0; //For the workshops page (WP Masonry Layout Plugin) } }
Many thanks
Masonry Guy
KeymasterHi Oliver,
In that case you need to add this filter as well.
function trim_excerpt($text) {
return rtrim($text,'[…]’);
}
add_filter(‘get_the_excerpt’, ‘trim_excerpt’);Thanks
- AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)