[Resolved] Views pagination and Shortcodes Ultimate plugin
This thread is resolved. Here is a description of the problem and solution.
Problem:
I have a view that displays posts with ajax pagination enabled.
I have also a plugin "shortcodes ultimate" that triggers a popup that contains information related to the post being clicked on.
The problem is that the popup is not being triggered after navigating to a page in the view.
Solution:
The issue here is that the Views plugin loads the elements dynamically using ajax and because the click events are not being bound to the newly loaded elements, the event is not being triggered and the popup doesn't show.
So, please make sure that if a plugin is triggering an event, he should use the Jquery "on" function to bind the event to the newly loaded elements in the document like the following example:
$(document).on('click','.su-lightbox', function (e) {});
This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
I am using the Shortcodes Ultimate plugin to insert a shortcode in a view with pagination that loads more details about the post in a lightbox. It works well until the pagination is used, and then does not function again on that particular paginated section. (I have about 5 paginated views on my home page as section sliders.)
I'm unsure of why it would work perfectly until the pagination is used. Have you had any other reports of this? Or are you able to replicate it?
Here is the code I'm using in my content template.
To be honest, I didn't see other clients reporting issues regarding "Shortcodes Ultimate plugin".
It seems that we have a compatibility issue. If we are talking about the lightbox that can't be triggered, then I doubt that it's a Javascript error prevents the lightbox to trigger.
So, please enable WordPress debug mode: https://codex.wordpress.org/Debugging_in_WordPress
And open the browser console: hidden link then open the page where the problem could be replicated and reload the page again then check the console tab to check if there are any Javascript errors and share it with me in the next answer.
This is indeed the shortcodes ultimate issue because they didn't take into account the ajax loading for the element.
View loads the elements dynamically using ajax and because the click events are not being bound to the newly added elements, the event is not being triggered and the popup doesn't show.
I've debugged the issue and found the cause behind this.
in file \wp-content\plugins\shortcodes-ultimate\assets\js\other-shortcodes.js , replace line 60 which is :
$(this).on('click', function (e) {
by the following line
$(document).on('click','.su-lightbox', function (e) {
And see if the issue is resolved.
If this worked for you, you can mention the workaround to the plugin author.