WordPress.org

Support

Support » Themes and Templates » syntax problems in If statement using in_category

syntax problems in If statement using in_category

  • Having some trouble with a loop. Currently starting a bunch of loop conditionals for the loop file. This is the first and only loop so far and I’m having syntax issues. The basic loop works fine. Please help.

    <?php if (have_posts()) : while (have_posts()) : the_post() ; ?>
    <?php if  (in_category ('programs')) {
    	<h1 class="section">echo 'Classes'; </h1>
    }
     else  {
    	<h1 class="section">  echo get_the_title( $post->post_parent ); </h1>
    }
     endif;
    	<a href="<?php the_permalink(); ?>"><h1 style="font-weight:bold"><?php the_title(); ?></h1>  </a>
    ?>
    <?php the_content(); ?>
    <?php endwhile; endif; ?>

  • The topic ‘syntax problems in If statement using in_category’ is closed to new replies.
Skip to toolbar