WordPress.org

Ready to get started?Download WordPress

Forums

WP Testimonial Widget
Shortcodes not working (4 posts)

  1. John O
    Member
    Posted 5 months ago #

    Hi,

    I am working on a client website and I am trying to use your testimonials plugin. I can get the widget working fine, but when I try to use the shortcode, nothing happens.

    when I view source on the page that should be displaying testimonials i see the following markup:

    <script type="text/javascript">
           (function(){
                var strEffect = '';
                if(strEffect != 'none')
                {
                  jQuery('.data_display').cycle({
                      fx: strEffect,
                      timeout: ''
                  });
                }
            })(jQuery);
        </script>
        <div class='data_display'>
          		</div>

    Any idea where I am going wrong? Thanks.

    John

    https://wordpress.org/plugins/wp-testimonial-widget/

  2. ArtisticAdam
    Member
    Posted 5 months ago #

    John, I was having the same issue today with the shortcodes..Seems if you use order you must also use orderby. The example shortcode in the help section is wrong, try this.

    [swp-testimonial testimonials="1" order="asc" orderby="id" effects="scrollRight" time="5000"]

  3. ArtisticAdam
    Member
    Posted 5 months ago #

    alternatively you can include default values in the shortcode.php lines 8-12 like this.

    function swpt_testimonial_shortcode($atts){
    	extract(shortcode_atts(array(
       		'testimonials' => '1',
       		'order' => 'asc',
          'orderby' => 'id',
          'effects' => 'fade',
          'time' => '5000',
          ), $atts));

    this way you can use the shortcode with any combination of the available attributes and it will display correctly.

  4. John O
    Member
    Posted 5 months ago #

    Hi Adam,

    Thanks for this, I'll give it a go. :-)

    John

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.