I'm using Wordpress and a plugin called Testimonials Widget which creates a post type of its own for rotating testimonials with testimonialswdiget_widget() or a list with testimonialswidget_list(). I don't have all my code yet because I can't even get this part to work yet --
<?php
if ($all_the_tags);
$all_the_tags = get_the_tags();
foreach($all_the_tags as $this_tag) {
echo do_shortcode('[testimonialswidget_list tags="<?php echo $this_tag->name; ?>" limit=2]');
}
?>
Currently that code is displaying every testimonial I currently have in the system (2) for as many times as there are tags on the post. If there are no tags, it doesn't display anything.
What I'm trying to do is display testimonials in the sidebar which share a tag with the current post. If I'm on a page, I would like to display all testimonials. I will change them all to the rotator type after, I'm using list as a debug. So I don't care if it shows the same testimonials twice or 3 times or 5 times, or if there's 25 tags so there's 25 testimonials. That doesn't matter (except when it comes to query loads, I get it, so perhaps an iteration limiter so it doesn't become 30?).
Anyone got any ideas?