Forums

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

  1. pressup
    Member
    Posted 1 month 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?

    Thanks.

  2. fitztrev
    Member
    Posted 1 month 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
    Member
    Posted 1 month 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.

Reply

You must log in to post.

About this Topic