Is it possible to convert a posts tags to a div class? I have the following loop:
<div class="results">
<?php query_posts('cat=3'); while(have_posts()): the_post(); ?>
<div class="query">
<b><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></b><br />
<div class="tags"><img src="<?php bloginfo('stylesheet_directory');?>/images/tags.png" />
<?php $args = array(
'smallest' => 8,
'largest' => 22,
'unit' => 'pt',
'number' => 0,
'format' => 'array', // important
'separator' => '\n',
'orderby' => 'name',
'order' => 'ASC',
'exclude' => '',
'include' => '',
'link' => 'view',
'taxonomy' => 'post_tag',
'echo' => false );
$tag_list = wp_tag_cloud( $args );
$i = count($tag_list);
$sep = ', '; // enter your own seperator string
foreach($tag_list as $tags) {
echo strip_tags($tags);
if($i == 1) { continue; }; $i--; // don't show last sep after the list
echo $sep;
}
?>
</div>
</div>
<?php endwhile; ?>
</div>
The div that already has a class of query, I want the posts tags all to be listed as classes. Is that possible?
Here is the site: http://wpdev.connectionsquad.com/fitness/workouts/