Rendering Blocks Loaded Via AJAX
-
Hi
I created a page that has a scrollable column of post listings in the left column, and a single post in the right column. I look for clicks on the posts in the left column using jQuery and load the relevant post in the right column using ajax and jQuery. No page refresh. I do it primarily to prevent a refresh of the left column on page load.
Its working perfectly except for block editor items like a slideshow, or gallery. The required CSS and JS doesn’t seem to be written in page via the_content(). I found this:
https://github.com/WordPress/gutenberg/issues/2768
and this:
Am I right in thinking blocks require inline css and js? When does that get added to the page? Can I force it? It seems like in my example above, when the page first loads, blocks are rendered on the post side, but when I add a post to the right side via ajax and jQuery, the blocks are not rendered. is wp_footer() the key?
Any advice, guidance, pointers, flicks in the ear (??), greatly apprecaited. Thank you!
Regards
Mike
- The topic ‘Rendering Blocks Loaded Via AJAX’ is closed to new replies.