WordPress: Kategorie als class

mit diesem einfach Code kann man die Kategorie als Klasse (class) vergeben:

<?php post_class(); ?>

In Gebrauch sieht es bei mir dann so aus:


<article <?php post_class(); ?>>

<h2>
<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
</h2>

<div class="entry">
<?php the_content(); ?>
</div>

<p class="postmetadata"><?php the_category(', '); ?> am <?php the_date('d-m-Y') ?></p>

</article>

Kommentar hinterlassen

die E-Mail Adresse wird niemals publiziert. Pflichfelder sind mit einem * gekennzeichnet

darfs ein wenig HTML sein?
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>