gpt4 book ai didi

html - 如何在wordpress中合并css

转载 作者:太空宇宙 更新时间:2023-11-04 10:09:54 26 4
gpt4 key购买 nike

我想将所有 css 合并到一个文件中。我可以手动完成,但我不明白 wp_register_style 的最后一个参数。

从笔记本电脑加载所有 CSS。

        wp_register_style('desktop-small-css', get_template_directory_uri().'/css/desktop.small.css','','','(max-width:'.get_option($dynamo_tpl->name . '_theme_width', '1230').'px)');
wp_enqueue_style('desktop-small-css');

wp_register_style('tablet-css', get_template_directory_uri().'/css/tablet.css','','','(max-width:'.get_option($dynamo_tpl->name . '_tablet_width', '1030').'px)');
wp_enqueue_style('tablet-css');

wp_register_style('tablet-small-css', get_template_directory_uri().'/css/tablet.small.css','','','(max-width:'.get_option($dynamo_tpl->name . '_small_tablet_width', '820').'px)');
wp_enqueue_style('tablet-small-css');

wp_register_style('mobile-css', get_template_directory_uri().'/css/mobile.css','','','(min-width:'.get_option($dynamo_tpl->name . '_mobile_width', '580').'px)');
wp_enqueue_style('mobile-css');

最佳答案

https://codex.wordpress.org/Function_Reference/wp_register_style ,

我猜这是一个媒体查询,找出哪个样式表适用于哪个设备并删除/编辑 $media 选项。删除所有 wp_register_style$media 选项并在样式表中添加 @media() 媒体查询可能会容易得多。

关于html - 如何在wordpress中合并css,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37697585/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com