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

Hi I have a problem with the_title filter:

I have this code at my constructor:

add_filter( 'the_title', array($this, 'change_title') );

and this as callback (for testing purposes)

 public function change_title($title)
    return 'title';                 

But is filtering my navigation items! instead of show home, pages, etc all changed to 'title' screenshoot

Any Ideas how to fix it?

share|improve this question
up vote 6 down vote accepted

You can try the in_the_loop() conditional to check if the context of the_title is within the loop.

share|improve this answer
like a charm, thank you! – greenbandit Mar 29 '12 at 16:22

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.