Output a Random Testimonial

Sometimes, you want to display a random testimonial somewhere on your site. The following guide will walk you through the different ways of doing so.

You can output a Random Testimonial in a Page or a Post by using our Shortcodes. Our shortcodes can be easily generated using our Shortcode Generator, under our Options screen, or by clicking the Testimonial button above the Edit pane and using our Widget to generate the shortcode. You can also use our Widgets in any widgetized area of your website.

  • To output a Random Testimonial, place the following shortcode in the desired area of the Page or Post Content:
    // Output a single, randomly selected testimonial
    [random_testimonial]
  • To display more than one Random Testimonial, use the following shortcode, where count is the number of testimonials you want displayed.
    // Output 3 randomly selected testimonials
    [random_testimonial count='3']
    
    // Output 10 randomly selected testimonials
    [random_testimonial count='10']
    
    // Output 20 randomly selected testimonials
    [random_testimonial count='20']
  • To display the title above the Random Testimonial and use excerpts (short versions of the Testimonial), use the following shortcode:
    // Output a single testimonial, show its title, and use an excerpt for the content
    [random_testimonial show_title='1' use_excerpt='1']
    
    // Output up to 5 testimonials, show its title, and use an excerpt for the content
    [random_testimonial show_title='1' use_excerpt='1' count='5']
    
    // Output up to 10 testimonials, using the Card Style - Maroon theme, show the titles, and use excerpts
    [random_testimonial show_title='1' use_excerpt='1' count='10']
  • To limit your random testimonials to a specific category, use the category attribute:

    // Show a single random testimonial from a specfic category
    [random_testimonial category='the_category_slug']
    
    // Show a single random testimonial from a specfic category and show thumbnails
    [random_testimonial category='the_category_slug' show_thumbs='1']
    
    // Show 10 random testimonials from a specfic category and show thumbnails
    [random_testimonial category='the_category_slug' show_thumbs='1' count='10']
    
    // Show 10 random testimonials from a specfic category and show thumbnails using the Card Style - Maroon theme
    [random_testimonial category='the_category_slug' show_thumbs='1' count='10' theme="card_style-maroon"]
    
    // Show 10 random testimonials from a specfic category, show thumbnails and titles, and use the Card Style - Maroon theme
    [random_testimonial category='the_category_slug' show_thumbs='1' show_titles='1' count='10' theme="card_style-maroon"]
  • To display the rating along with the random testimonial, use the following shortcode:
    // Show the rating as stars, outside the content
    [random_testimonials show_rating='stars']
    
    // Show the rating as a number, before the content
    [random_testimonials show_rating='before']
    
    // Show the rating as a number, after the content
    [random_testimonials show_rating='after']

Screenshots

This is the Random Testimonial widget. This can be used to generate a Random Testimonial shortcode or to display a random testimonial in any widgetized area of your website.