- This topic has 3 replies, 2 voices, and was last updated 3 years, 5 months ago by Tom.
-
AuthorPosts
-
October 7, 2020 at 4:53 am #1476243nanni75
Hello,
I have just updated to GeneratePress 3.0 and I am using a child theme (which it’s using only style.css and functions.php files).
After switching to “external files” and “Flexbox” in the Customizer, the printed HTML code in the Head section of the site outputs the following:
<link rel='stylesheet' id='generate-widget-areas-css' href='https://www.example.com/wp-content/themes/generatepress/assets/css/components/widget-areas.min.css?ver=3.0.0' media='all' /> <link rel='stylesheet' id='generate-style-css' href='https://www.example.com/wp-content/themes/generatepress/assets/css/main.min.css?ver=3.0.0' media='all' /> <style id='generate-style-inline-css'> #nav-below {display:none;}.resize-featured-image ... etc </style> <link rel='stylesheet' id='generatepress-dynamic-css' href='//www.example.com/wp-content/uploads/generatepress/style.min.css?ver=5.5.1' media='all' /> <strong><link rel='stylesheet' id='generate-child-css' href='https://www.example.com/wp-content/themes/generatepress_child/style.css?ver=1599233625' media='all' /></strong> <link rel='stylesheet' id='generate-blog-css' href='https://www.example.com/wp-content/plugins/gp-premium/blog/functions/css/style.min.css?ver=1.12.1' media='all' /> <link rel='stylesheet' id='generate-navigation-branding-css' href='https://www.example.com/wp-content/plugins/gp-premium/menu-plus/functions/css/navigation-branding-flex.min.css?ver=1.12.1' media='all' /> <style id='generate-navigation-branding-inline-css'> @media (max-width: 1000px){.site-header, #site-navigation ... etc </style>
I can see that the style.css of the child theme it is not loaded as the last one.
Would it be possible to load the style.css of the child theme at the bottom as the last one in order to give it the power to override all others inline and external CSS definitions?
Thanks and and a big thumb up for your great work!
October 7, 2020 at 8:28 am #1476817TomLead DeveloperLead DeveloperHi there,
Absolutely – try this function:
add_action( 'wp_enqueue_scripts', function() { wp_dequeue_style( 'generate-child' ); wp_enqueue_style( 'generate-child' ); }, 99 );
Let us know ๐
October 7, 2020 at 9:19 am #1476918nanni75Hi Tom,
I have just tried and it works just fine! Thank you.
To add it as the very last one of the css files, I have increased the number from 99 to 999:
add_action( 'wp_enqueue_scripts', function() { wp_dequeue_style( 'generate-child' ); wp_enqueue_style( 'generate-child' ); }, 999 );
Thanks a lot for your help!
October 7, 2020 at 9:23 am #1476933TomLead DeveloperLead DeveloperYou’re welcome! ๐
-
AuthorPosts
- You must be logged in to reply to this topic.