• pressup

    (@pressup)


    In my plugin, when I filter ‘the_title’, I find that not only is the post title filtered, all the post titles in the sidebar are filtered as well. How do I only filter the ‘the_title’ in the current post?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • fitztrev

    (@fitztrev)

    I don’t think it’s possible. You could edit your templates to make your own title function used only for posts.

    Thread Starter pressup

    (@pressup)

    O.K. I’ve figured it out. There’re only a handful of pages I need to do that for. So, what I did was to add in a token <!–newtitle–> to the title of those pages. Then I filter ‘the_title’ only when the <!–newtitle–> exists.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘‘the_title’ – How to filter only in Post and Not in Sidebar?’ is closed to new replies.