Display relevant taxonomy tags beside each post within Loop
-
I have a couple of different taxonomies – ‘resources’ and ‘get-involved’ – with a number of terms within each.
I am displaying a custom loop on my homepage which will show content across all taxonomies which have been added to a ‘featured’ category.
I am wondering how I could add in the relevant taxonomies within the loop. For example:
<title>
<excerpt>
<taxonomies that this item has selected… eg: Case Studies, Report>
<featured image>Just to confuse things further, I am displaying them as multiple loops (hopefully the code makes sense!) as per https://perishablepress.com/multiple-loops-and-multiple-columns-with-wordpress/ This is my code:
<?php query_posts('showposts=2, cat=19'); ?> <?php $posts = get_posts('numberposts=2&offset=0'); foreach ($posts as $post) : start_wp(); ?> <?php static $count1 = 0; if ($count1 == "2") { break; } else { ?> <div class="homeresources"> <h3> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_title(); ?> </a> </h3> <span class="homeresourcestext"> <?php my_excerpt(5); ?> </span> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail(); ?> </a> </div> <?php $count1++; } ?> <?php endforeach; ?> <?php query_posts('showposts=1'); ?> <?php $posts = get_posts('numberposts=1&offset=2'); foreach ($posts as $post) : start_wp(); ?> <?php static $count2 = 0; if ($count2 == "1") { break; } else { ?> <div class="homeresources3"> <h3> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_title(); ?> </a> </h3> <span class="homeresourcestext"> <?php my_excerpt(5); ?> </span> <a title="<?php the_title(); ?>" href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"> <?php the_post_thumbnail(); ?> </a> </div> <?php $count2++; } ?> <?php endforeach; ?>
Any advice welcomed! Thanks in advance.
- The topic ‘Display relevant taxonomy tags beside each post within Loop’ is closed to new replies.