Minification breaks plugin

Home Forums Any Mobile Theme Switcher Minification breaks plugin

This topic contains 3 replies, has 2 voices, and was last updated by  Dinesh 8 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6159

    mobidesktop

    Hello, I had AMTS working well and appreciated. Then I took advice and began working on minifying my CSS theme files, including removing all CSS comments such as “Theme Name.” This appears to break function of plugin.

    Is there any way to fully minimize theme CSS and still use AMTS?

    Thanks for any ideas or help.

    Mobi

    #6160

    Dinesh
    Keymaster

    Hi,

    I think you removed the comments in your style.css of your theme file. Please don’t do that. Those comments are most important for theme to work. So after removing the theme if means that there is no proper information of your theme. So it is not working. Please check this https://codex.wordpress.org/Theme_Development#Theme_Stylesheet . Here you will find infos about it. And technically these are the comments you shouldn’t remove.

    Thanks

    #6169

    mobidesktop

    Ok, thanks, I’ve since learned that it is impossible to fully static minify a WordPress theme css file, due to the necessity of the header comment stating the name of the theme, and the fact that full minification deletes all comments. I did discover that WordPress theme css file (usually style.css) only needs one comment at the beginning and the rest can by minified. If anyone lands here looking for information, the only comment that’s necessary would look like this, located at exact beginning of the css file:

    /* Theme Name: this-is-the-theme-name */

    I hope that helps someone looking for info.

    #6173

    Dinesh
    Keymaster

    Hi,

    Thank you so much for sharing the info here. Hope this will help other having such issue.

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Minification breaks plugin’ is closed to new replies.