shivani parmar
shivani parmar

Reputation: 334

How to merge css in wordpress

I want to merge all css into one file. I can do manually but I don't understand last argument of wp_register_style.

From laptop it's load all 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');

Upvotes: 0

Views: 79

Answers (1)

poashoas
poashoas

Reputation: 1894

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

I guess it's a mediaquery, find out which stylesheet is for which device and remove/edit the $media option. It might be a lot easier to remove the $media option of all wp_register_style and add @media() media queries inside your stylesheets.

Upvotes: 1

Related Questions