WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Why isn't this working? (3 posts)

  1. Pete
    Member
    Posted 2 years ago #

    display posts according to different categories using the same index.php template...

    This is place inside my loop

    <?php if( is_category('1') ) : ?>
    <h1>Perth <?php the_title(); ?> Limestone Rendering</h1>
    
    <?php elseif( is_category('7') ) : ?>
    <h1>Perth <?php the_title(); ?> Rendering</h1>
    
    <?php endif; ?>
  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    is_category() is for category archives;
    http://codex.wordpress.org/Function_Reference/is_category

    in_category() is for a post category;
    http://codex.wordpress.org/Function_Reference/in_category

  3. Pete
    Member
    Posted 2 years ago #

    whoops thanks

Topic Closed

This topic has been closed to new replies.

About this Topic