-
Oliver
Hello Support-Team,
I’ve recreated the issue on a fresh WordPress 6.5.3 installation.
These are the changes I did:
Theme installed: GeneratePress 3.4.0
Modules activated: Blog and SpacingPlugins installed: GenerateBlocks 1.9.1, GenerateBlocks Pro 1.7.0, GP Premium 2.4.0 and Yoast Duplicate Post.
GenerateBlocks Settings -> CSS PRINT METHOD -> Inline Embedding
Appearance Customize – Use infinite scroll
I’ve created 24 posts containing a grid, a container, an image and a more element. All IDs are unique.
Grid: HORIZONTAL ALIGNMENT Center
Container: GRID ITEM WIDTH (%) 50
Image: HEIGHT 300px, OBJECT-FIT Contain
In blog mode, the styling for the first post (Test 24) is embedded in the header.
The style tags for posts 1-9 (Test 23-15) are embedded in the tags.
the style tags for post 10/20 (Test 14/Test 4) are missing when infinite scroll is activated
loading directly page 2/3 then Test 14/Test 4 is first on each page and the style tags are embedded in the header tag
-
David
Hi there,
i am going to speak to Tom and the devs on this, as i its a peculiar one. Will reply asap.
-
David
GB renders local block styles on post render. It effectively parses the post for its blocks, extracts the block attributes and compiles the necessary CSS
Part of this process includes where it should load the CSS as an inline<style>
, which it does IF there is very little CSS on the post.But its not built for parsing inside the loop, i assume its working to some degree because of the way WP generates the post excerpt when using the MORE TAG. But i would have expected this to fail entirely and not just the first post of each pagination load.
What is it you’re trying to achieve in the loop ?
-
Oliver
I don’t use any loop. I just enabled infinite scroll on the theme.
-
David
Sorry what i meant by the loop is your blog / index / archive pages.
-
David
Try adding this PHP Snippet to the site:
add_filter( 'generateblocks_do_inline_styles', function( $do ) { if ( is_archive() ) { // For example. return true; } return $do; } );
This will force GB into using inline styles on the archive.
But… we are still not sure this will work with infinite scroll
- You must be logged in to reply to this topic.