WordPress.org

Ready to get started?Download WordPress

Forums

GC Testimonials
limiting the number of words (4 posts)

  1. judsouza
    Member
    Posted 1 year ago #

    limiting the number of words will appear

    http://wordpress.org/extend/plugins/gc-testimonials/

  2. devnz
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. BerryIntlOnline
    Member
    Posted 1 year 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
    Member
    Plugin Author

    Posted 1 year 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

About this Topic