CSS/JS not being minified
-
Hi, I am just wondering if I am doing something wrong here.
In my functions.php I have the following:add_action('wp_footer', 'setup_css_js'); function setup_css_js() { wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js', array(), '3.5.1', false); wp_enqueue_script('jquery'); wp_enqueue_script('MobileMenu', THEME_STATIC . '/js/mobile-menu.js'); wp_enqueue_script('dropdownContainer', THEME_STATIC . '/js/dropdown-container.js'); wp_enqueue_script('searchTabs', THEME_STATIC . '/js/search-tabs.js'); wp_enqueue_script('tileSlider', THEME_STATIC . '/js/tile-slider.js'); wp_enqueue_script('artSlider', THEME_STATIC . '/js/art-slider.js'); wp_enqueue_script('artGallery', THEME_STATIC . '/js/art-gallery.js'); wp_enqueue_script('scrollToTop', THEME_STATIC . '/js/scroll-to-top.js'); wp_enqueue_script('JS', THEME_STATIC . '/js/index.js'); wp_enqueue_style('typography', THEME_STATIC . '/css/typography.css'); wp_enqueue_style('bootstrap', THEME_STATIC . '/css/bootstrap.css'); wp_enqueue_style('global', THEME_STATIC . '/css/global.css'); wp_enqueue_style('custom_buttons', THEME_STATIC . '/css/buttons.css'); wp_enqueue_style('container', THEME_STATIC . '/css/container.css'); wp_enqueue_style('grid', THEME_STATIC . '/css/grid.css'); wp_enqueue_style('art-slider', THEME_STATIC . '/css/art-slider.css'); wp_enqueue_style('sidebar', THEME_STATIC . '/css/sidebar.css'); wp_enqueue_style('header', THEME_STATIC . '/css/header.css'); wp_enqueue_style('footer', THEME_STATIC . '/css/footer.css'); }But even with these 3 settings enabled none of these files get minified:
Optimise CSS Code
Aggregate CSS-files
Also aggregate inline CSSYou can still see all of the css files being imported in the footed:
<link rel='stylesheet' id='typography-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/typography.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='bootstrap-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/bootstrap.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='global-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/global.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='custom_buttons-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/buttons.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='container-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/container.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='grid-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/grid.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='art-slider-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/art-slider.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='sidebar-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/sidebar.css?ver=6.0.1' type='text/css' media='all' /> <link rel='stylesheet' id='footer-css' href='/wp-content/themes/Libraries-Tasmania-Wordpress-Theme/static/css/footer.css?ver=6.0.1' type='text/css' media='all' />Also all of the css files I am using within my custom blocks are also not being minified. Some css does just nothing that is declared via wp_enqueue_style within my theme.
The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
The topic ‘CSS/JS not being minified’ is closed to new replies.