If in parent category
<p>I have this structure</p>

<p>Category > Subcategory > Post</p>

<p>I´m trying to display some content if the user it´s on a specific category, or in it´s subcategory or post.</p>

<p>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:</p>

<pre><code>    &lt;?php if(is_category('catering')){?&gt;
        &lt;div class="logo"&gt;
            &lt;img src="&lt;?php bloginfo('template_directory') ?&gt;/images/canal.png" /&gt;
        &lt;/div&gt;
        &lt;div class="carta_catering"&gt;
                          &lt;p&gt;texto&lt;/p&gt;
        &lt;/div&gt;
    &lt;?php    }  ?&gt;
</code></pre>

<p>I tried with if(in_category) but it still didn´t show anything on single.php.</p>

<p>Any ideas?</p>
