WordPress.org

Support

Support » Plugins and Hacks » [Plugin: GC Testimonials] limiting the number of words

[Plugin: GC Testimonials] limiting the number of words

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author devnz

    @eringarscadden

    This is on the current “To Do” list. Thanks

    BerryIntlOnline

    @berryintlonline

    For a solution in the mean time, as of WordPress 3.3 there is a new function – wp_trim_words(). At about line 740 in testimonials.php, you’ll see this line:

    echo '<div class="content">'.$testimonial->post_content.'</div>';

    If you add use the new function you’ll end up with something like this:

    echo '<div class="content">'.wp_trim_words($testimonial->post_content,$num_words = 25, $more = '... ').'</div>';

    Just replace ’25’ with the number of words that you want to limit the testimonial widget to.

    I used this on a home page of the site I’m developing and some of the testimonials are paragraphs long. This made my home page incredibly long. I needed to limit the amount of words in the widget because I was using the option of “Read More Testimonials” so the user could navigate to the testimonial page if they wanted to read more.

    Hope that makes sense and that it helps in the mean time until official support is integrated.

    Plugin Author devnz

    @eringarscadden

    Thanks BerryIntlOnline, I will add this in the very next release.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: GC Testimonials] limiting the number of words’ is closed to new replies.