I have created a custom post type – Testimonials – for a WP site I am working on. I want to display a single random testimonial in my sidebar – without using a plugin if possible. Do I need to create a text widget with the proper post query? If so, what would it look like?
Many thanks,
Cynthia
If you want you can directly paste following code snippet in your
sidebar.php
where you want to show theTestimonials
(make sure whether it’stestimonials/Testimonials
)