Support » Plugin: GC Testimonials » Widget cycling messes up on Testimonials page

Viewing 12 replies - 1 through 12 (of 12 total)
  • Javascript error. The pagination script (Quickpager) for the [full-testimonials] page is not being loaded. This trips an error that prevents the rest of the Javascript from running, including the Cycle plugin for the widget.

    In your other fixes, do you remember disabling pagination?

    Thread Starter Alexis403

    (@alexis403)

    Hi Chris, you were the one who helped me before. 🙂 If you click on this link: http://wordpress.org/support/topic/gc-testimonials-causes-another-plugin-to-not-work?replies=5 you’ll see the code that I replaced. I didn’t want to copy and paste the code here because it was corrected at the bottom and I didn’t want things to get confusing. I just skimmed it and I didn’t see pagination in the code, but please take a look and see if I missed anything. Thanks.

    I support all code changes I recommend 🙂

    I checked those code changes again. They should not have interfered with the pagination script, but I did not attempt to re-create the problem so I will do that next.

    It would be helpful if you could do this: Create a page with the [full-testimonials] shortcode showing 5 per page that does not have the testimonial widget anywhere on the page. That will show us whether or not pagination works independently of the widget cycling. Then give me the link to that page and I will look at the code.

    Also, please confirm that your theme’s footer.php contains lines similar to this:

    <?php wp_footer(); ?>
    </body>

    Thread Starter Alexis403

    (@alexis403)

    Hi, I did what you asked, created a page so that the footer area does not show in order for the widget not to show on that page. I also changed the settings to only show 5 per page, but it’s still displaying 7. I changed the setting after putting the shortcode on the page, but that shouldn’t matter right? Any time I change settings, it should automatically effect the shortcode right? Is this what you mean by the pagination not working properly? Here’s the page: http://alexistmyers.com/test-2/

    Thread Starter Alexis403

    (@alexis403)

    Also, here’s the code in my theme’s footer.php file:

    <?php

    /**
    * Call footer elements.
    */
    function thesis_footer_area() {
    thesis_hook_before_footer();
    thesis_footer();
    thesis_hook_after_footer();
    }

    /**
    * Display primary footer content.
    */
    function thesis_footer() {
    echo “\t<div id=\”footer\”>\n”;
    thesis_hook_footer();
    thesis_admin_link();
    wp_footer();
    echo “\t</div>\n”;
    }

    /**
    * Display default Thesis attribution.
    */
    function thesis_attribution() {
    echo “\t\t<p>” . sprintf(__(‘Get smart with the Thesis WordPress Theme from DIYthemes.’, ‘thesis’), ‘http://diythemes.com/thesis/&#8217;) . “</p>\n”;
    }

    Thanks Alexis. Yes, changing the settings affects any and all shortcodes, provided you refresh the page.

    That new page confirms that the pagination script is not working regardless of whether the page has a testimonial widget or not.

    Specifically, the Quickpager jQuery plugin included in GCT is not loading. (I can show you how I found that out if you want to know for future debugging.)

    I have not been able to re-create the problem using the default theme and I don’t have a copy of Thesis.

    The GCT pagination script is set to be loaded by wp_footer() which is in your footer.php though not in the right place according to the WordPress Codex.

    Please confirm this code is in your testimonials.php around line 54:

    if ( strstr($post->post_content, '[full-testimonials') ) {
    	add_action('wp_footer', 'gct_custom_pagination');
    	wp_enqueue_script('gct-pager', plugins_url('/assets/js/quickpager.jquery.js', __FILE__ ), array('jquery'), '1.0', true);
    }

    Stay with me here. We’ll figure it out.

    Thread Starter Alexis403

    (@alexis403)

    Hi Chris, thanks for working through this with me. Yes, that code is in my testimonials.php.

    Thread Starter Alexis403

    (@alexis403)

    What’s next?

    Let’s try this. In that last section of code in testimonials.php that I asked you to look for, the true at the end of this line

    wp_enqueue_script('gct-pager', plugins_url('/assets/js/quickpager.jquery.js', __FILE__ ), array('jquery'), '1.0', true);

    tells it to load in the footer instead of in the <head> where scripts normally go. Remove the true so the line looks like this:

    wp_enqueue_script('gct-pager', plugins_url('/assets/js/quickpager.jquery.js', __FILE__ ), array('jquery'), '1.0');

    I tried this on mine and the pagination still works. If it works for you, then your theme is not allowing scripts to be loaded in the footer for some reason.

    Thread Starter Alexis403

    (@alexis403)

    That worked! The test page is now showing the pagination, and my testimonials page is showing things correctly! Thanks so much! Not sure why my theme is not allowing scripts to be loaded in the footer, but I do know that I adjusted the Cyclone Slider 2 plugin to load scripts in the header instead of the footer so that it would work correctly along with the GC Testimonials plugin after a recent upgrade. So I don’t know if that’s effecting this or not. Just glad everything is working now. Thank you!

    Excellent! You’re very welcome.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Widget cycling messes up on Testimonials page’ is closed to new replies.