Support » Plugin: TBTestimonials » Display just one testimonial

  • Resolved mjpg


    I am calling:


    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?


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Travis Ballard


    showposts should still work, i’ll look intot his one fo ryou tonight and get back to you.


    Thanks for your reply.

    It is working now. Not sure what changed. The code I am using in my theme index.php is:

    // add testimonial - output set from TBTestimonials Output Settings admin page

    Seems fine. Sorry to trouble you.


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Display just one testimonial’ is closed to new replies.