GC Testimonials
limiting the number of words (4 posts)

  1. judsouza
    Posted 3 years ago #

    limiting the number of words will appear


  2. devnz
    Plugin Author

    Posted 3 years ago #

    This is on the current "To Do" list. Thanks

  3. BerryIntlOnline
    Posted 3 years ago #

    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.

  4. devnz
    Plugin Author

    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • GC Testimonials
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic