Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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');
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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