Hi,
I was wondering if anybody is able to help me out with the following query:
I am trying to display a list of tag titles with their respective post titles underneath in the sidebar. I put this together:
<?php $posthead = get_posts(array('orderby' => 'name', 'order' => 'ASC', 'category' => '3,5,6,7,8')); foreach($posthead as $post) : setup_postdata($post); ?>
<h2><?php $posttags = get_the_tags($post->ID);
foreach($posttags as $tag) {
echo $tag->name . ' ';
}
?></h2>
<p><?php the_title(); ?></p>
<?php endforeach; ?>
The issue with this is that the post will display multiple versions of the same tag title.
Any help on how I could write this would be greatly appreciated.
Thanks!