filter single_cat_title avoiding the breadcrumbs


I’m developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page.

Just doing this:

function subtitleCategory ($title) {
    return $title."</div></div></div><div class="container_24"><h2 id="category-subtitle">TEST1</h2></div>";

add_filter('single_cat_title', 'subtitleCategory');

I get what I need. But I noticed that this filter also apply to the breadcrumbs (there is a call in breadcrumbs.php) and this means twice in the same page (not what I need).

Do you know if there is a condition that can be applied to filter just the title and not the breadcrumbs? I tried in_the_loop, is_category, is_archive, is_tax etc etc without success.

Yes, breadcrumbs.php is a theme file and you should not take it in consideration. I’m trying to achieve an admin panel where your can put some text (with html) for every category and this text will be displayed just after the title in the category page. I’m trying to do this with a plug in and, for this reason, this can’t be coupled with any theme dependency.

, , kekko12 8 years 2014-03-09T09:47:39-05:00 0 Answers 82 views 0

Leave an answer