0

I'm using a function:

function widget_new_title($title) { echo word_limiter($title,20); } add_filter('widget_title','widget_new_title');

to limit the characters for widget title but my problem is that if I do this, the title is not wrapped in before_title and after_title as well as before_widget and after_widget.

Any help?

Thanks, Cip

1 Answer 1

1

don't use echo in filter functions - use return:

function widget_new_title($title) { 
return word_limiter($title,20); } 

add_filter('widget_title','widget_new_title');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.