I'm trying to display a random post from a custom post type where the posts have a category of "Images".
This is my code so far, I don't understand why it's not working?
<?php
$the_query = new WP_Query( array ( 'orderby' => 'rand', 'post_type' => 'testimonial', 'posts_per_page' => '1', 'category_name' => 'images' ) );
while ( $the_query->have_posts() ) : $the_query->the_post();
?>
<div class="feature boxed testimonials">
<?php the_content(); ?>
</div>
<?php
endwhile;
wp_reset_postdata();
?>