Advertisement
Guest User

fefefef

a guest
Oct 2nd, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Adds custom CSS to the wp_head() hook.
  4.  *
  5.  *
  6.  * @package WordPress
  7.  */
  8.  
  9.  
  10. if ( !function_exists( 'sn_custom_css' ) ) {
  11.    
  12.     add_action('wp_head', 'sn_custom_css');
  13.     function sn_custom_css() {
  14.            
  15.             $custom_css ='';   
  16.  
  17.             if(sn_option('enable_fixed_header') == '1') {
  18.            
  19.             $custom_css .= '
  20.  
  21.  
  22.  
  23.             .header-fixed {  background: transparent url(wp-content/themes/theme-name/assets/images/mix1.png) repeat-x                     !important;  }
  24.  
  25.                 ';
  26.             }  
  27.            
  28.             //trim white space for faster page loading
  29.             $custom_css_trimmed =  preg_replace( '/\s+/', ' ', $custom_css );
  30.        
  31.             //echo css
  32.             $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
  33.            
  34.             if(!empty($custom_css)) {
  35.                 echo $css_output;
  36.             }
  37.     }
  38.    
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement