Displaying a Random Testimonial on your website is a great way to keep your content fresh by showing different testimonials on each Page. And with Easy Testimonials Pro, it couldn’t be simpler to display a Random Testimonial anywhere on your website.
If you’re using the latest version of WordPress (WordPress 5 or newer), simply add a Random Testimonial block to any Page or Post. You can find the Random Testimonial Block under the Easy Testimonials Category.
If you’re using an older version of WordPress or the Classic Editor, you can use our Shortcodes instead. Simply add a random_testimonial shortcode to any Page or Post, and a random testimonial will be displayed in that location.
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 wizard to generate the shortcode.
You can also place the Random Testimonial widgets into any widgetized area of your website to display a Random Testimonial in that location.
- 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
![](png/screenshot-20.png)