{"id":18432316,"date":"2025-04-23T18:19:35","date_gmt":"2025-04-23T18:19:35","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=18432316"},"modified":"2025-04-23T19:00:05","modified_gmt":"2025-04-23T19:00:05","slug":"jetpack-slideshow-block-rendering-after-asynchronous-load-2","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/jetpack-slideshow-block-rendering-after-asynchronous-load-2\/","title":{"rendered":"JetPack Slideshow Block rendering after asynchronous load"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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.<br \/><br \/>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.<br \/><br \/>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:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wordpress.org\/support\/topic\/rendering-blocks-loaded-via-ajax\/\">https:\/\/wordpress.org\/support\/topic\/rendering-blocks-loaded-via-ajax\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I tried the solutions on this page:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/stackoverflow.com\/questions\/72635660\/inline-styles-for-gutenberg-blocks-not-rendering-when-content-fetched-with-ajax\">https:\/\/stackoverflow.com\/questions\/72635660\/inline-styles-for-gutenberg-blocks-not-rendering-when-content-fetched-with-ajax<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">They didn\u2019t work in my case. Others seem to have the issue:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/stackoverflow.com\/questions\/78519520\/jetpack-gutenberg-slideshow-block-not-working-or-rendering-on-custom-ajax-infini\">https:\/\/stackoverflow.com\/questions\/78519520\/jetpack-gutenberg-slideshow-block-not-working-or-rendering-on-custom-ajax-infini<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/wordpress.org\/support\/topic\/gutenberg-slideshow-block-not-rendering-with-custom-infinite-load-posts\/\">https:\/\/wordpress.org\/support\/topic\/gutenberg-slideshow-block-not-rendering-with-custom-infinite-load-posts\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I think it might be related to this:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/Automattic\/jetpack\/issues\/19182\">https:\/\/github.com\/Automattic\/jetpack\/issues\/19182<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I build my HTML using the_content(), I\u2019ve tried the function to change the block flags and wp_render_layout_support_flag(), I\u2019ve tried running do_action(\u2018wp_footer\u2019); after the code has been placed using JS with a further ajax call.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It seems like I need to initiate the JetPack Slideshow block after an asynchronous load. Or maybe I am missing something.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A quick note, the same Slideshow block renders fine on the custom post type&#8217;s single page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Any insights or suggestions greatly appreciated.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Regards<br \/>Mike<\/p>\n","protected":false},"template":"","class_list":["post-18432316","topic","type-topic","status-publish","hentry","topic-tag-ajax","topic-tag-render"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18432316","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18432316\/revisions"}],"predecessor-version":[{"id":18432369,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18432316\/revisions\/18432369"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18432316"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}