Display just one testimonial
-
I am calling:
tbtestimonial('random');
and expected just one testimonial, but all seem to be output.
I looked in
tb-testimonials.php
line 736 and assumed that:$q = new WP_Query( array( 'post_type' => 'testimonial', 'post_status' => 'publish', 'orderby' => 'rand', 'showposts' => 1 ) );
would only output one due to
'showposts' => 1
but I assume my knowledge of WP is not correct.(saw this on the WP class reference:
Display one random post: $query = new WP_Query( array ( 'orderby' => 'rand', 'posts_per_page' => '1' ) );
[‘posts_per_page’ is preferred to ‘showposts’]
Or is there another way to achieve this with tbtestimonial?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display just one testimonial’ is closed to new replies.