

If you're looking for a class that minifies both Javascript and CSS, then you can use the Minify package written by MatthiasMullie. Either: redirecting style.css to style.php or rewriting it or making an empty style.css and include style. However, since most themes user a quicktaggy : getbloginfo(‘stylesheeturl’), then it must be style.css since that bloginfo-thing looks for style.css. The end result is a new file which is smaller in size to the original, yet identical from a machine perspective. Using PHP in CSS in WordPress is no problem just like a normal file.
Minify css with php how to#
In this article you will learn how to minify your CSS and JS code with 3 different libraries. What is Minification Minification refers to the process of removing all unnecessary characters from a file while leaving the core functionality of the code in tact. If you want more reasons about why you should use a library, we recommend you to read this great article.

CSS minifier tool reduces file size and removes spacing, indentation, newlines. Whatever the intention you have with the implementation of a minifier in your server, as always, we recommend you to don't reinvent the wheel (don't build your own minifier with PHP) and use a library. Online CSS minifier / compressor tool minify and compress your CSS. Minifying files can have a real world performance difference in your project, not about the performance of your code in the browser, but the speed at which the user receives it and the load of the server when the file needs to be served for a lot of simultaneous connections.
