我想加载自定义布局样式的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