Hallo Leute,
ich brauche mal Hilfe bei einen Loop.
Also die Loopausgaube haut hin und alles klappt ohne Probleme.
Nun hätte ich aber gern das jede 2. Zeile der Tabelle mit einer Farbe hinterlegt ist. Das bekomme ich hin wenn ich jedem 2. tr Tag eine klasse odd dran hänge.
Wie schreibe ich das aber im Loop?
Hier der Normale Loop.
PHP
<table width="500" border="0" cellspacing="0" cellpadding="0">
<?php $query_loop1 = new WP_Query('showposts=5'); ?>
<tr class="odd">
<td width="100" class="bigdate"><?php the_time('d.m.Y'); ?></td>
<td width="300"><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></td>
<td width="100" class="tabkat"><?php the_category(', '); ?></td>
</tr>
<?php endwhile; ?>
</table>
Und so sollte dann die 2. Zeile im Quellcode ausschauen:
Code
<tr class="odd">
<td width="100" class="bigdate">24.05.2009</td>
<td width="300">Schlüsselbund gefunden!</td>
<td width="100" class="tabkat">Allgemeines</td>
</tr>
Danke für jede Hilfe!!!