sagive

custom css in head

Mar 8th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. function custom_xcss_wphead() {
  2.    
  3.     // CUSTOM CSS IN SPECIFIC POST
  4.     $customCss  =   get_post_meta(get_the_ID(), 'xCustomCss', true);
  5.     if($customCss && !is_home() && !is_category() && !is_search()) {
  6.         $customCss = '<style type="text/css">'.$customCss.'</style>';
  7.         echo $customCss;
  8.     }
  9.    
  10. }
  11. add_action('wp_head', 'custom_xcss_wphead');
Advertisement
Add Comment
Please, Sign In to add comment