CUstom taxonomies & CSS class
-
Hi,
I’m running my portfolio with WordPress and created a custom post type called “portfolio”, with a couple taxonomies (categories for my portfolio items).
I’d like to use the name of the taxonomies as CSS classes. I was using “<?php echo $term->slug; ?>”, but I changed my query, because I had some items showing twice, since they are listed under 2 taxonomies.
Here is my new code :
<ul id="portfolio"> <?php query_posts('post_type=portfolio&posts_per_page=200'); if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <li class="<?php echo $term->slug; ?>"> <a href="<?php echo get_permalink($term_post->ID); ?>" title="<?php echo get_the_title($term_post->ID) ?>"><?php echo get_the_post_thumbnail($term_post->ID, 'slider'); ?><span class="title"><?php echo get_the_title($term_post->ID) ?></span></a></li> <?php endwhile; wp_reset_query(); ?> </ul>Any help would be appreciated,
Thanks in adavance !
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘CUstom taxonomies & CSS class’ is closed to new replies.