Link to an internal CSS using PHP
-
Hello Helpers !
I have a small problem here: I did a SEO test for my WordPress site with GTMETRIX and I got some errors that I wish to fix all to increase my SEO score and become more friendly with search engines (especially with Google).
They told me to Inline my small css files like the subscriptions.css of the Jetpack plugin:
https://www.mydomain.com/wp-content/plugins/jetpack/modules/subsriptions/subscriptions.cssSo I did copy the code inside subscriptions.css and I pasted it between
<style type="text/css">
and<style>
tags in the head section (header.php), then I deleted the subscriptions.css file.The internal CSS code that I’ve added to header.php works fine.
THE PROBLEM:
Ine the phph file of the Jetpack plugin, there is a line of PHP code that calls for the CSS file that I’ve deleted (subscriptions.css) like so:
wp_register_style( 'jetpack-subscriptions', plugins_url( 'subscriptions/subscriptions.css', __FILE__ ) );
I need to replace the subscriptions/subscriptions.css with a link to my
<style type="text/css">
that I’ve added to header.phpTell me how please … Thank You
- The topic ‘Link to an internal CSS using PHP’ is closed to new replies.