Title: conditional script not working
Last modified: August 19, 2016

---

# conditional script not working

 *  [Ruriko](https://wordpress.org/support/users/ruriko/)
 * (@ruriko)
 * [17 years, 4 months ago](https://wordpress.org/support/topic/conditional-script-not-working/)
 * I got the if script working but the problem is the <?php the_title(); ?> & <?
   php the_category(‘, ‘) ?> aren’t working! anyone know why?
 *     ```
       <?php
       $in_subcategory = false;
       foreach( explode( "/", get_category_children( 8 ) ) as $child_category ) {
       if(in_category($child_category))$in_subcategory = true;
       }
   
       if ( $in_subcategory || in_category( 8 ) ) {
       echo '<p class="postmetadata alt">
       						<?php the_title(); ?> is filed under <?php the_category(', ') ?> category. You can visit the <?php the_category(', ') ?> category to find all the episodes of this series.
   
       ';
       } else {
       echo '<span class="bad-cat">Not tasty! Not healthy!</span>';
       }
       ?>
       ```
   

The topic ‘conditional script not working’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [Ruriko](https://wordpress.org/support/users/ruriko/)
 * Last activity: [17 years, 4 months ago](https://wordpress.org/support/topic/conditional-script-not-working/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
