我只想在特定的网站类型(文章(single.php)、类别(category.php)和404页面(404.php))上导入样式。我尝试使用is\\u page(),但我不知道它是否适用于不同的网站类型。谢谢你的帮助。
Update这就是我试过的
wp_register_style(\'style-narrow\', \'/wp-content/themes/my theme/css/style-article-narrow.css\');
if ( is_singular() ) {
wp_enqueue_style(\'style-narrow\', \'general\', \'1.0\', \'screen\');
}
以及wp_register_style(\'style-narrow\', \'/wp-content/themes/my theme/css/style-article-narrow.css\');
if ( is_page_template( \'category.php\' ) ) {
wp_enqueue_style(\'style-narrow\', \'general\', \'1.0\', \'screen\');
}