plugin development – How to check parent & child category

Question

I just want to display a section in the parent category. And I want to display another section in the child category. How to do it?

      if ( is_category() ) {
          get_template_part( 'template-parts/banner/tab-1' , 'xcde' ); 
        } else {
           get_template_part( 'template-parts/banner/tab-2' , 'xcde' ); 
       ]
    

0
cholonto 3 months 2021-05-15T05:54:22-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse