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?
lien caché
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.
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
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.
OK, I'll try reaching out to WP Bakery support then.
Sure, let me know if there's anything you need from me to facilitate that conversation.