我正在從textarea中添加CSS。有沒有辦法在<head>
在WordPress中將頭部添加到輸出時縮小CSS中的內容
CSS添加時,我可以很容易地再壓縮輸出
#logo img{
opacity: 0.8;
}
#header{
background-color: red;
}
function add_css_to_head(){
$opt = get_option('get_css_head');
echo '<style type="text/css" id="get_css_head">' . "\n" . stripslashes($opt) . "\n" . '</style>';
}
add_action('wp_head', 'add_css_to_head');
我想提前在<head>
#logo img{opacity:.8}#header{background-color:red}
由於這樣的輸出
它完美地工作的人。讓我測試一下這個有點全面,我會更新。這將被接受的答案。讓我再檢查一次。 – Ayanize
是的。我是這樣得到的。再次感謝。它工作可愛。 – Ayanize