Ready to get started?Download WordPress


'the_title' - How to filter only in Post and Not in Sidebar? (3 posts)

  1. pressup
    Posted 6 years ago #

    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?


  2. fitztrev
    Posted 6 years ago #

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

  3. pressup
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic