2012-09-17 50 views
0

誰能告訴我如何通過插件添加代碼到head.php主題?wordpress頭文件代碼插件

我想在其中添加一些外部.css文件? FYI

add_action('wp_head', 'your_function'); 
    function your_function(){ 
     wp_register_style('external_css', 'EXTERNAL CSS PATH');   
     wp_enqueue_style('external_css'); 

    } 

回答

2

你應該在你的插件使用下面的代碼可能是你提不完整的文件名,這是應該的header.php,請確認。 希望這段代碼能幫助你。一切順利;)