嘿大家我嘗試了以下方法無濟於事。style.css在自定義創建的WordPress主題中沒有被調用?
首先
<?php
wp_head();
wp_enqueue_style("style.css",get_template_directory_uri());
?>
二
<?php
wp_head();
wp_enque_style("style.css",get_stylesheet_uri());
?>
三
<?php
wp_head();
function my_assets() {
wp_enqueue_style('style' , get_template_directory_uri() .'/style.css');
}
add_action('wp_enqueue_scripts', 'my_assets');
do_action("wp_enque_scripts");
?>
目錄結構
hospital_theme[
style.css
index.php
header.php
footer.php
sidebar.php
]
主題是自定義用戶創建,它是從HTML文件轉換爲WordPress主題。目前主題只包含5個文件,即header.php,footer.php,sidebar.php,index.php,style.css。
我已經使用get_header(),get_footer()成功調用各個文件的內容。
試過了不行 – phpNoob