WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

share|improve this answer

Your Answer


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.