WordPress.org

Ready to get started?Download WordPress

Forums

syntax problems in If statement using in_category (1 post)

  1. lberelson
    Member
    Posted 6 months ago #

    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; ?>

Reply

You must log in to post.

About this Topic