Adding Random Testimonials To The Sidebar

Adding Random Testimonials to the sidebar is easy.  Just follow these simple steps.

  1. Activate the Advanced Text Widget.
  2. Go to WiseBusiness Options and select the category you would like to display in the widget.
  3. Go to Appearance – Widgets
  4. Add the Advanced Text Widget to the Sidebar you want to display your Testimonials.
  5. Add the following code:

[sourcecode=plain]<!– Random Testimonial –>
<h2 class="testimonials">Random Testimonial</h2>
<div class="boxRight testimonialsList">
<ul>

< ?php
$testimonial = new WP_Query($query_string.’&amp;cat=’.get_option(‘wise_testimonials_id’).’&amp;showposts=1&amp;orderby=rand’);
if ($testimonial -> have_posts()) : while ($testimonial -> have_posts()) : $testimonial -> the_post();
?>
<li><span>~ < ?php the_title(); ?></span>
<p>< ?php the_post_thumbnail();?>"< ?php content(‘1000’); ?>"</p>
</li>
< ?php endwhile;
endif; ?>
<li><a href="<?php echo get_category_link(get_option(‘wise_testimonials_id’) )?>"><strong>Read more testimonials &amp;raquo;</strong></a></li>

</ul>
<!– end random testimonial –>[/sourcecode]

That’s it! You’re ready to go!

Leave a Reply