JetPack Slideshow Block rendering after asynchronous load
-
I am using an AJAX request to load a custom post type with a JetPack Slideshow block in it and place it on a page.
I pass a post id to PHP from a JS AJAX request. In PHP I do a query loop on that post id, build some HTML, then return it to JS and place it on the page using jQuery.
This all works well, but the JetPack slideshow is blank, all the HTML appears correct, but it does not appear to be initiated. I asked about it before once:https://ww.wp.xz.cn/support/topic/rendering-blocks-loaded-via-ajax/
I tried the solutions on this page:
They didn’t work in my case. Others seem to have the issue:
I think it might be related to this:
https://github.com/Automattic/jetpack/issues/19182
I build my HTML using the_content(), I’ve tried the function to change the block flags and wp_render_layout_support_flag(), I’ve tried running do_action(‘wp_footer’); after the code has been placed using JS with a further ajax call.
It seems like I need to initiate the JetPack Slideshow block after an asynchronous load. Or maybe I am missing something.
Any insights or suggestions greatly appreciated.
Regards
Mike
The topic ‘JetPack Slideshow Block rendering after asynchronous load’ is closed to new replies.