我想加載自定義佈局樣式的index.php。我的主題叫做劍道,我試圖在functions.php中抽出一些自定義樣式表。WordPress的 - 加載自定義CSS在index.php
樣式表單獨運行(例如,如果我刪除一行),但它們保持相互覆蓋。我的代碼有問題嗎?
function kendo_scripts() {
wp_enqueue_style('kendo-style', get_stylesheet_uri());
if (is_page_template('index')) {
wp_enqueue_style('kendo-layout-style1', get_template_directory_uri() . '/layouts/no-sidebar.css');
}
if (!is_page_template('index')) {
wp_enqueue_style('kendo-layout-style2', get_template_directory_uri() . '/layouts/content-sidebar.css');
}
請詳細說明你正在努力實現。 – Nilambar