Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Obscure CSS inside WP

         

toplisek

8:53 am on Mar 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I try to remove or hide obscure CSS from a WP theme. As all CSS is inside min. CSS in another folder, how to eliminate browser request without broken WP theme. This CSS is empty and it is without function but WP forces themes/themeID/style.css?ver=2021-03-18

toplisek

5:14 pm on Mar 27, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have seen it is inside PHP files and removed it.

not2easy

5:20 pm on Mar 27, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Are you using a child theme and are the files you have edited part of your theme files or are they WP php files? I ask because if the files are WP php files you should copy any edited files to your child theme directory so they would not be replaced with unedited versions at the next update.

toplisek

5:32 pm on Mar 27, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is functions.php. Due to forum limitations, it can not be added images if I understand.
wp_enqueue_style()

not2easy

6:13 pm on Mar 27, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That file (functions.php) is part of your theme, so a WP update will not alter that. It is a good idea to keep a 'note to self' record of the change you made, so if you change or update your theme in the future you will know to check/edit that file again. ;)

martinibuster

7:23 pm on Mar 28, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



That's not an obscure style. That's the theme's css with a versioning parameter added to the end.

Versioning is a workaround to make sure that the latest version of the style sheet is served to users who might have an old version cached in their browser.

toplisek

7:24 pm on Apr 11, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Is it true that wp_enqueue_style() can be hidden but a new installation of the theme will not work if wp_enqueue_style() is missing?
How to remove a versioning parameter which is added to the end?