Support » Plugin: GC Testimonials » Widget cycling messes up on Testimonials page
Widget cycling messes up on Testimonials page
-
Hello, I am having a problem where the Testimonials widget is out of whack only on one page. I have the widget in my footer so it shows on every page. It’s only when I get to my actual Testimonials page, where the widget acts up. You can see it here: http://alexistmyers.com/testimonials/ scroll to the bottom and you’ll see the problem.
But if you look at any other page of my site, you’ll see that it works correctly. I will leave several links here so you can see:
http://alexistmyers.com/
http://alexistmyers.com/about-alexis/
http://alexistmyers.com/web-design/You’ll see that in the footer on every other page it’s showing correctly. So is there some type of code that will make the widget work correctly when it’s showing on the Testimonials page where the actual short code for the testimonials is located?
Also, for reference, I recently adjusted some PHP code for this plugin to get it to work correctly with another plugin. So in case this makes a difference, here’s the post where I got the help: http://wordpress.org/support/topic/gc-testimonials-causes-another-plugin-to-not-work?replies=5
Any help is appreciated!
-
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?
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>
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/
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/’) . “</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 yourfooter.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.
Hi Chris, thanks for working through this with me. Yes, that code is in my testimonials.php.
What’s next?
Let’s try this. In that last section of code in
testimonials.php
that I asked you to look for, thetrue
at the end of this linewp_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 thetrue
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.
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.
- The topic ‘Widget cycling messes up on Testimonials page’ is closed to new replies.