I need to use an if statement to detect if the category page that is currently being viewed is from a category list being lifted from wordpress. I cant use a static list as this list is likely to change as the admin changes things.
<?php
$args = array(
'orderby' => 'name',
'parent' => 8,
'taxonomy' => 'category'
);
$categories = get_categories( $args );
foreach ( $categories as $category1 ) { ?>
<?php if (is_category(<?php echo get_cat_name("$category1->term_id;"); ?>)) : ?>
<p>This is the text to describe category A</p>
<?php else : ?>
<p>This is the text to describe category B</p>
<?php endif; ?>
}?>
This is what I have so far, it works if I use a static list but when I try and get the is category to work with the get_cat_name it gives me an error 500.
Thanks.