Bug #24966
open
Added by Laurie Hurson about 12 hours ago.
Updated about 7 hours ago.
Category name:
WordPress Plugins
Description
Hi all,
I have a faculty member asking about this site: https://lib100oer.commons.gc.cuny.edu/modules/
She writes "It seems like something has changed with Atomic Blocks, and the grid & list views don't display the way they used to. For example, our Course Modules page looks right when we're editing it, but doesn't display the same way on the frontend."
I do see what she is saying- the display in the page editor has text next to images and it does not display this way on the front end. She thought it might be related to Atomic blocks but i don't think that's the issue here because as far as I can tell the list on this page is not using an atomic block? I have also tried to change the lay out etc on this page to get the front end to display correctly but cannot figure it out.
I feel like this might be a frustratingly simple fix or something I am missing? Can you take a look?
thanks!
- Category name set to WordPress Plugins
- Status changed from New to Reporter Feedback
- Target version set to 2.7.3
Hi Laurie,
The grid on the Modules page is using an Atomic Block called "Post and Page Grid". I took a closer look into the Atomic Blocks plugin and it seems that their frontend CSS isn't being enqueued on the page, which is why the frontend layout does not match the editor layout.
I've added a fix to enqueue the frontend CSS for Atomic Blocks if the current post or page contains any Atomic Block in https://github.com/cuny-academic-commons/cac/compare/d6f58f4...3b73e5f and have pushed the fix to production. The Modules page for the LIBR 100 site should now look correct. This should also cover any other site using Atomic Blocks in their posts.
Boone, the way I'm checking for if an Atomic Block is added to a singular post is with a preg_match() check. The reason why is WordPress does not have a function that checks if a post contains any block from a certain namespace; WordPress only has the has_block() function, which only checks individual blocks. It's not the most elegant solution, but let me know if there is a better way.
Also available in: Atom
PDF