How to toggle a css class based on Taxonomy
-
I am not proficient with php so could someone please help me. I want to be able to have a div element to check if a particular taxonomy is selected or not and choose between two classes based on the results.
This is the code I already use to insert an image, which I want to replace:
<?php $terms = get_the_terms($post->ID, 'status'); foreach( $terms as $term) { echo '<IMG CLASS="statusPos-list" SRC="' . get_bloginfo('template_url') . '/images/status-' . $term->slug . '.png" ALT="*" />'; break; } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘How to toggle a css class based on Taxonomy’ is closed to new replies.