jeudi 7 mai 2015

I need if (is_category ( )) to display content ONLY on parent category, not on child category pages

I need to display an intro paragraph on an archive page that displays all posts in the parent and child categories. I'm adding the required content via a sidebar widget and I have code that displays it correctly.

if( is_category( '28' ) || get_sidebar('blog-intro'));

The problem is the side bar widget also displays on all child pages for category 28 => 28/a, 28/b,... I need it on just category 28. Any ideas on how I can filter that out?

Aucun commentaire:

Enregistrer un commentaire