Advertisement
wpexplorer

Custom CSS Output Function

Nov 28th, 2011
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. function kraken_custom_css() {
  2.    
  3.         global $data;
  4.        
  5.         /**custom css field**/
  6.         if(!empty($data['custom_css'])) {
  7.             $custom_css .= $data['custom_css'];
  8.         }
  9.        
  10.         /**custom color options**/
  11.         //main highlight
  12.         if(!empty($data['main_color'])) {
  13.             $custom_css .= '.home-blog-thumb a:hover,a:hover .home-blog-thumb,.blog-post a:hover img,.widget-recent-portfolio a:hover img,.portfolio-item a:hover img,#single-portfolio a:hover img,.blog-right a:hover img,.related-post-image a:hover img,.attachment-post-thumbnail a:hover,.image-gallery-entry a:hover img,a:hover .staff-image { background-color: '.$data['main_color'].'; }';
  14.         }
  15.        
  16.        
  17.         /**echo all css**/
  18.         $css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css . "\n</style>";
  19.        
  20.         echo $css_output;
  21. }
  22.  
  23. add_action('wp_head', 'kraken_custom_css');
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement