I have this structure
Category > Subcategory > Post
I´m trying to display some content if the user it´s on a specific category, or in it´s subcategory or post.
I´m using this code but it only works if the user is in the category.php, not if the user it´s on a single.php that belongs to the that parent category:
<?php if(is_category('catering')){?>
<div class="logo">
<img src="https://wordpress.stackexchange.com/questions/73420/<?php bloginfo("template_directory') ?>/images/canal.png" />
</div>
<div class="carta_catering">
<p>texto</p>
</div>
<?php } ?>
I tried with if(in_category) but it still didn´t show anything on single.php.
Any ideas?