WordPress.org

Ready to get started?Download WordPress

Forums

need help with ifelse statements (1 post)

  1. gerld
    Member
    Posted 7 years ago #

    hey all.. i'm trying to write a simple little ifelse statement to filter out a couple categories ... but i keep getting an error, and i'm not sure what's wrong with what i have.. do you see anything jumping out at you ? all these endifs and endwhiles are confusing me

    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); { ?>
    <?php if ( in_category('10') ) { ?>
    // ignore category 10 and do nothing and move on
    <?php } ?>
    <?php elseif ( in_category('3') ) { ?>
    // ignore category 3 and do nothing and move on
    <?php } ?>
    <?php else { ?>
    &raquo; <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a><br />
    <?php } ?>
    <?php endif; ?>
    <?php } ?>
    <?php endwhile; endif; ?>

    any help would be greatly appreciated!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.