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.
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.
I don't think it's possible. You could edit your templates to make your own title function used only for posts.
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.
You must log in to post.