Last active
October 30, 2017 10:18
-
-
Save sergeliatko/8242f89c90fcb879abefaaedf7bf5fae to your computer and use it in GitHub Desktop.
How to add inline styles to theme stylesheet in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Adds extra CSS rules to the HEAD html tag after to your theme stylesheet. | |
*/ | |
function my_extra_css() { | |
wp_add_inline_style( | |
sanitize_title_with_dashes( wp_get_theme()->get( 'Name' ) ), | |
'/*** YOUR CSS HERE ***/' | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_extra_css', 10, 0 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment