Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Minify CSS
#5
(2021-01-23, 23:46:51)Knobbles Wrote: Hello,
when exactly does the problem occur?
After activating it, or when using one of its functions?
You say it gives an error, what does the error message say? And which PHP version is used?

I found that you were/are testing GetSimple 3.4. Do you also use it here? I do not know whether this plugin is compatible, because it was made and is currently in use with GetSimple 3.3.16.

***

No need to modify the gsconfig file.

Both functions do generally the same, they minify the css file(s) and provide the URL path of the minified version.
Which of the functions will be needed depends on what you want to achieve.

As usual with GetSimple, the get... function
Code:
get_minify_css()
echoes its result (which is the path to the minified css file) to the browser,

while the return... function
Code:
return_minify_css()
returns the path to the calling php function.


So if you just want to minify your css file and then refer the minified css in the HTML header of your template, you just insert there
Code:
<link rel="stylesheet" href="<?php get_minify_css('css/mystyle.css'); ?>" />
and it will point to the generated 'css/mystyle.min.css'.
I feel this is the most common usage.

But perhaps you wish to minify and after this do something more with the minified file, you might want to call it from functions.php.
Then you will probably use
Code:
return_minify_css('css/mystyle.css');
which returns the path to 'css/mystyle.min.css' to the caller, which in turn will do further work on this.

I hope usage is more clear now.

Now it works.
I was inserting a / before the path. Like this ('/css/mystyle.css');
Thank you for the promptly response.
Reply


Messages In This Thread
Minify CSS - by Knobbles - 2020-08-11, 20:29:49
RE: Minify CSS - by zekoolweb - 2020-08-31, 21:25:23
RE: Minify CSS - by krlllo - 2021-01-21, 01:27:19
RE: Minify CSS - by Knobbles - 2021-01-23, 23:46:51
RE: Minify CSS - by krlllo - 2021-02-17, 11:05:50



Users browsing this thread: 1 Guest(s)