Ich habe eine Schleife in meinem index.php
und ich möchte Kategorie-ID hinzufügen schreiben Klasse
i viele Code try'd aber ich did't den richtigen Code
hier bekam ist Was ich habe:wie man Post Kategorie ID
<?php if (have_posts()):?>
<?php $catID = get_the_category('id');?>
<ul>
<?php while(have_posts()): the_post();?>
<li class="cat<?php get_the_category($post->ID);?>">
<a href="<?php the_permalink();?>">
<?php $src= wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), array(250,220), false, ''); $thumbnailSrc = $src[0]; ?>
<img class="thumbnail" src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $thumbnailSrc;?>&w=250&h=220&zc=1q=100" alt="">
<span class="hover"></span>
<h2><?php the_title();?></h2>
<h3>توضیحات بیشتر<?php echo $catID; ?></h3>
</a>
</li>
<?php endwhile;?>
</ul>
<?php endif;?>