How to Display a Random Testimonial or Post in WordPress

Set up a testimonials category — no need for a plugin.

There are a couple of plugins designed specifically for testimonials, but I didn’t want to use them; they use their own databases, and don’t keep with WordPress’ simplicity. If possible, the best way to work with WordPress is to use it’s built-in functionality.

I also wanted to have the testimonials as a category in WP, rather than as a separate plugin. This code will work for any type of category, not just a testimonial.

Here’s how to create a random post item in your sidebar: Continue reading “How to Display a Random Testimonial or Post in WordPress”