您的源代码中并未包含文件名... bloginfo('stylesheet_url')仅返回样式表的链接...文件夹URL通常是主题文件夹。您还需要添加文件夹(如果有)和filename.css。
请记住,编码时始终要考虑WordPress标准。链接到样式表不是最佳实践。这可以启用适当的缓存和效率,并且从长远来看更容易。
从我上周末读的免费300页书- WordPress AJAX,第53页:
// load styles + conditionally load an IE 7 stylesheet
add_action('init', 'my_theme_register_styles');
function my_theme_register_styles() {
//Register styles for later use
wp_register_style('my_theme_style1', get_stylesheet_directory_uri() . '/style1.css', array(), '1.0', 'all');
wp_register_style('my_theme_style2', get_stylesheet_directory_uri() . '/style2.css', array('my_theme_style1'), '1.0', 'all');
wp_register_style('my_theme_style3', get_stylesheet_directory_uri() . '/style3.css', array('my_theme_style1', 'my_theme_style2'), '1.0', 'all');
global $wp_styles;
$wp_styles->add_data( 'my_theme_style3', 'conditional', 'lte IE 7' );
}
将以下内容放到functions.php或header.php中,它会根据条件正确加载IE的样式表...