- This topic has 5 replies, 2 voices, and was last updated 1 month, 1 week ago by David.
July 4, 2022 at 7:44 am #2272675Matthias
i am nearly done with a website and now wanted to move almost all css from the customizer to the style.css of my child theme.
For some reason this breaks some parts – buttons i had vertical on the right+left side of the page now are no longer alignet – and i cant figure out why. If i copy+paste the code back from style css into customizer->additional css it works again.
Isn’t it possible to add some css-Types/phrases into the style.css? As it works when i copy the broken parts back it probably shouldnt be caused by a paste error. Really weird. Do you have a clue why?
I read in a topic here that its better to keep most css in the child themes style.css so thats why.July 4, 2022 at 8:05 am #2272855DavidStaffCustomer Support
try loading the child theme styles later, see here:July 4, 2022 at 8:26 am #2272879Matthias
thx that worked – at least on my hosters page.
For some reason it does not work in the sandbox on my local machine. Do you know if there are any php packages or similar needed (i have wordpress running locally on a ubuntu server virtual machine and sync to my hoster via wordmove)?July 4, 2022 at 8:38 am #2272888DavidStaffCustomer Support
No, that code i provided is using the core
wp_enqueue_scriptshook, thats built into WP.
The only other issues could be:
a. the directory structure ie. where the child theme style.css is located, but if that were different it wouldn’t load at all.
b. Page Caching ? do you have that on your VM ? As it may just need a refreshJuly 5, 2022 at 1:21 am #2273444Matthias
thx – i will look into it – i actually have quite a basic installation on my vm – not many php-modules. I have to look which one is missing – not really familiar with all there is. php8.1-opcache is installed + enabled.
But i am happy as long as it works on the live server.
btw – what is a weird coincidence: i get the same behaviour on the live server when i activate autoptimize settings
(Aggregate all linked CSS-files? If this option is off, the individual CSS-files will remain in place but will be minified.) If deactivated its fine – but i get the same gap / misplaced button (between menu and page content). This error also still is viewable as soon as i open the customizer – even when the setting is deactivated. I asked this already in another topic.July 5, 2022 at 3:41 am #2273554DavidStaffCustomer Support
When you aggregate all linked files, autoptimize scrapes all those links, grabs their CSS and combines them into one file.
This can sometimes lead to breakages, due to the files being combined a different order, or a minor error in one CSS file breaking the subsequent styles.
There isn’t much we can do about that. Frank over at Autoptimize might provide some advice on it.
- You must be logged in to reply to this topic.