Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Adds custom CSS to the wp_head() hook.
- *
- *
- * @package WordPress
- */
- if ( !function_exists( 'sn_custom_css' ) ) {
- add_action('wp_head', 'sn_custom_css');
- function sn_custom_css() {
- $custom_css ='';
- if(sn_option('enable_fixed_header') == '1') {
- $custom_css .= '
- .header-fixed { background: transparent url(wp-content/themes/theme-name/assets/images/mix1.png) repeat-x !important; }
- ';
- }
- //trim white space for faster page loading
- $custom_css_trimmed = preg_replace( '/\s+/', ' ', $custom_css );
- //echo css
- $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
- if(!empty($custom_css)) {
- echo $css_output;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement