<?php $c = 0;
if (have_posts()) : while (have_posts()) : the_post()
;$c++;
if( $c == 1 ) $my_id = ' id="first"';
else $my_id = ''; ?>
<div <?php post_class();?><?php echo $my_id;?>">
<h2 class="post-title"><a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php _e('Post');?> <?php the_ID(); ?> - <?php _e('permanent link');?>"><?php the_title();?></a></h2>
Thank you esmi,
For helping me with that.
I had to chop it about a bit (I think) to make it fit my category.php template and this is how it ended up.
<?php $c = 0;
if (have_posts()) : while (have_posts()) : the_post()
;$c++;
if( $c == 1 ) $my_id = ' id="first"';
else $my_id = ''; ?>
<?php if ( in_category('3') ) { ?>
<div class="post-cat-three"<?php echo $my_id;?> >
<?php } else { ?>
<div class="post" <?php echo $my_id;?>>
<?php } ?>
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
Did I do anything wrong?
Looks OK to me. Is it working?