Skip Navigation

[Closed] A view using pagination and Ajax doesn't show subsequent pages correctly

This support ticket is created 3 years, 8 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 5 replies, has 2 voices.

Last updated by Christian Cox 3 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1728481

Tell us what you are trying to do?
Trying to use Ajax pagination with Views on our homepage to show Posts previews

Is there any documentation that you are following?
No
Is there a similar example that we can see?
if you scroll down to "Inside Look" on our home page and try to use pagination, you'll see
that the view completely changes when loading the second post. It drops of the main image, etc. (Please note: the first two posts are the same)
What is the link to your site?
hidden link

#1728721
Screen Shot 2020-08-05 at 4.21.21 PM.png

Hello, I'll be glad to take a look and see what we can do to resolve this. There are some known issues with WPBakery shortcodes not being rendered as expected during AJAX events. You can try adding the following code to your child theme's functions.php file, or paste it into the end of a new code snippet in Toolset > Settings > Custom Code:

add_action('init', 'add_mapped_shortcodes_on_init');
function add_mapped_shortcodes_on_init() {
WPBMap::addAllMappedShortcodes();
}

That's my best guess, but you may need to contact WPBakery's support team to see if there is a better way to handle executing shortcodes during an AJAX load event. Or if they aren't able to help, disabling AJAX may be the best solution. Hopefully it won't come to that - hopefully the code above will take care of it.

#1729955

Hi Christian,

Thank you for your reply. I added the custom code to toolset, but I still have the same result.
Do you know how to disable Ajax in WPbakery so that we can test if that's the problem? I don't see any
documentation online to do that.

Thank you,
Joe

#1729981

Actually the AJAX I'm talking about is managed in the View, not in WPBakery. You would disable AJAX pagination in the View by selecting a pagination option that requires a page refresh. Those configurations are found in the Pagination section of the View editor or Block Editor, depending on how you created the View.

I did a quick test by using AJAX pagination to jump to page 2, then I refreshed the page in the browser. When the page reloaded, I could see the main image and the layout looked like the initial load on page 1. That's what led me to suspect AJAX is at the root of the problem. You should be able to use AJAX pagination to jump to any page, then refresh the browser. When the page reloads, that will give you an idea of what you can expect to see without AJAX pagination enabled.

#1729991

OK, I'll try reaching out to WP Bakery support then.

#1730003

Sure, let me know if there's anything you need from me to facilitate that conversation.

The topic ‘[Closed] A view using pagination and Ajax doesn't show subsequent pages correctly’ is closed to new replies.