带有媒体查询的Wordpress wp_enqueue样式表

时间:2013-10-11 13:36:18

标签: php wordpress css3 query-optimization

如果需要,我在html中使用媒体查询为网格加载新的样式表。我可以将其翻译为在我的functions.php中工作吗?

wp_register_style('html5blank', get_template_directory_uri() . '/style.css', array(), '1.0', 'all');
wp_enqueue_style('html5blank'); // Enqueue it!


<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/1140.css" type="text/css" media="all and (min-width: 1200px)" />

1 个答案:

答案 0 :(得分:6)

请参阅WordPress Codex中的wp_enqueue_style(),特别是最后一个参数与CSS媒体有关。

wp_enqueue_style('html5blank', false, array(), false, 'all and (min-width: 1200px)');
相关问题