- This topic has 3 replies, 3 voices, and was last updated 1 year, 2 months ago by Tom.
July 13, 2019 at 4:48 am #956659jasmeet
Although the site is still in pre-launch (staging) phase, Could see that Generatepress theme adds excessive DOM elements – appending to body class which is suggested to be avoided as seen here as it impacts site loading speed –
Note – Most of them are coming from default stage
Kindly suggest workaround for this
Attached screenshot also for reference
https://cl.ly/80db9254b252July 13, 2019 at 8:08 am #956885DavidStaffCustomer Support
you’re misreading the problem. This:
<body class="home page-template-default page page-id-2411 wp-custom-logo wp-embed-responsive post-image-aligned-center slideout-enabled slideout-mobile sticky-menu-no-transition sticky-enabled both-sticky-menu mobile-header mobile-header-sticky no-sidebar nav-float-right fluid-header separate-containers active-footer-widgets-1 nav-search-enabled header-aligned-left dropdown-hover offside-js--init customize-support" itemtype="https://schema.org/WebPage" itemscope="">
Is not an issue – what it says is there are 166 direct children within the body of the page. The Theme itself adds very little elements to the page. You can see this by testing the generatepress site.
The issue is related to the number of elements added in your content – some of the block plugins you’re using add a lot of element wrappers.July 14, 2019 at 4:18 am #957326jasmeet
Thanks – Will be doing my further research and reviewing as to where and how I can decrease number of parent elements although I had preferred to use Guternberg blocks this time instead of using Page builders for building pages for optimization purposes primarily 🙂
Although, I still wonder why does the theme have so many body classes even in “Default stage” – screenshot taken in default stage – https://cl.ly/3635a63bbe0d
and more keeps getting appended as we customize to add certain features like sticky bar etcJuly 14, 2019 at 9:49 am #957617TomLead DeveloperLead Developer
Those body classes allow us to use simple CSS to execute multiple options from the Customizer. It’s actually a far better approach (performance-wise) than using PHP to execute those options.
- You must be logged in to reply to this topic.