-
Hi there, a few weeks ago I updated GenerateBlocks on my site from v 1.9 to v 2.0 (and since to 2.0.1)
Since then, I am noticing many issues with Global Styles:
– Any new classes I add in the block editor, are not getting added to the global styles (ie I add a new class, then I add all of the settings to the class and save the post – despite the block editor saying that the class is being updated when I click save, the class does not get added to the global styles and the styling settings do not get added anywhere either)
– when I load on the front end and check my inspector, I can see that the class is added in the class attribute of the HTML, but nothing is loaded for the class in the stylesheet and therefore no styling is added either
– When I check in Generate Blocks > Global Styles, the class is not added there eitherI am using Gridpane for my hosting – everything was running fine when I was running on GenerateBlocks 1.9, it is only since updating to v 2 that this problem has started.
Please can you let me know if you are aware of this issue happening – and a fix for it? Or if there are any debugging steps I should take, please can you advise what they are? Then I will provide further information.
Many thanks in advance,
Keith
-
Hi there,
I haven’t heard about such an issue, can not replicate the issue on my end either.
Any chance you can provide an admin login to your site so I can do some test on your site?
Thanks!
-
Hi Ying, thanks for your help, access provided.
-
Alvind
Hi there,
By default, GenerateBlocks imposes a limit of 150 global styles that can be created. Since you’ve already reached that limit, you’re unable to add more.
However, you can override this limit by adding the following snippet:
add_filter( 'generateblocks_styles_posts_per_page', function() { return 200; // or any number you prefer } );
Adding PHP: https://docs.generatepress.com/article/adding-php/
-
Hi Alvind – what a strange restriction to have!
But thank you for letting me know. It might be worth adding some kind of notification to the block editor when you are trying to save a class (if you have hit the 150 class limit), plus also a link to a doc on how to remove that restriction (ie with that code snippet above). I’ve literally been tearing my hair out for 2 days trying to work out what was going on.
Best Regards,
Keith
-
Hi Alvind – what a strange restriction to have!
The global style sheet will be applied to every page. I don’t think it’s wise to create so many of them; the goal was efficiency, but having too many could negatively impact your site’s performance. I build large sites myself and have never used more than 30 global styles. In my opinion, 150 global styles should be more than sufficient.
It might be worth adding some kind of notification to the block editor when you are trying to save a class (if you have hit the 150 class limit)
Yes, I agree with that. I’ll mark the topic as improvement.
- You must be logged in to reply to this topic.