• 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.