WordPress.org

Ready to get started?Download WordPress

Forums

Testimonial Rotator
Shortcode for Excerpts (3 posts)

  1. hitenmehta34
    Member
    Posted 11 months ago #

    Hello,

    Can anyone help me with the shortcode please. I need to display testimonials excerpts only. I am not using the widget section. I am putting it on the homepage.

    Thank You

    http://wordpress.org/extend/plugins/testimonial-rotator/

  2. Hal Gatewood
    Member
    Plugin Author

    Posted 11 months ago #

    Unfortunetly there is now way to do this without modifying the plugin. If you want to do it, go into

    wp-content/plugins/testimonial-rotator/testimonial-rotator.php

    change line 429 from

    $slide .= " <div class=\"text\">" . apply_filters( 'the_content', get_the_content() ) . "</div>\n";

    to

    $slide .= " <div class=\"text\">" . get_the_excerpt() . "</div>\n";

  3. Frank van der Sluijs
    Member
    Posted 3 months ago #

    Hi Hal and others,

    I had a problem getting the shortcode to display the testimonials in a excerpt fashion, using for example [testimonial_rotator id=690 show_size=excerpt limit_length=265]

    Based on Testemonial Rotator Version 1.3.7 I got it to work.
    Not sure if this is the best solution since I am not an experienced developer, but this worked for me. I'm open to feedback from the pro's :)

    Modification 1 to testimonial-rotator.php:
    Adding this line at the first section of function testimonial_rotator($atts)
    $show_size = isset($atts['show_size']) ? $atts['show_size'] : "";

    Modification 2 to testimonial-rotator.php:
    Replacing this part to function testimonial_rotator($atts)
    $postcontent=apply_filters( 'the_content', get_the_content() ) ;

    with

    if ($show_size == "excerpt") {
      $postcontent=apply_filters( 'the_content', get_the_excerpt() ) ;
     }
     else {
      $postcontent=apply_filters( 'the_content', get_the_content() ) ;
    }

    Hope this helps people out!

    Would much appreciate it if a solution like this is included in the next version of the plugin.

    Thanks,
    - Frank

Reply

You must log in to post.

About this Plugin

About this Topic