I have created a Child Theme to customise style.css et function.php files.
I noticed that the css code in style.css does not work.
However, the same code in “Customize > addional CSS” works.
Php codes works in function.php, it only concern css in style.css
I also tried to put these codes in the parent theme files and it’s the same, the CSS is not applied, even with the !important rule…
Please make sure that the generated child theme loads its style.css file correctly, it should be loaded after the parent one (then the child theme’s styles will have a higher priority). You can check this in the functions.php file of the child theme.
In fact child’s theme are loaded before the parent for function.php, the “price field optionnal” is applied well.
This is not the case for style.css
But anyway, as long as I can modify function.php and css with the wp embedded editor it’s not a big deal.
I would like to know if this is normal or if it is a malfunction / bad installation ?
I think I’ll stay with the older Function.php codes generated by the Child Theme Wizard Plugin and put CSS codes in the embedded wp editor. I don’t want to take you so much time on it, It works for Function and I can apply custom CSS in another place so…
If you tell me that there is no danger or risk of conflict / something else I can stay like that.
Sure, you can keep CSS snippets using a third-party plugin or directly in Appearance/Customize/Additional CSS, but I recommend some solution for creating weekly website backups because in this case all the customizations are stored in the database. A child theme is required only if you want to override specific HTML parts of the parent theme, by copying them to the child theme folder.
The only requirement is to avoid editing the parent theme files directly. You can keep custom CSS in Appearance/Additional CSS or using third-party plugins, a child theme can be also used for this but it’s not required, it’s needed only if you want to override specific HTML template parts.
Understood ! Thank you for your help on this.
Last question to ensure my understanding > Is it well the code brought to function.php which allows to bypass the html ?
Please share more details about this issue, do you mean some specific code snippets in functions.php? Make sure that you don’t edit the parent theme’s functions.php file directly (or any of its files) because any direct changes are reset on update.
There are 4 ways to customize templates in HivePress:
Using custom code snippets for hivepress/v1/templates/{template_name} hooks. You can keep them using Code Snippets plugin (without a child theme) or in the child theme’s functions.php file.
By copying specific template parts from hivepress/templates to the child theme’s hivepress subfolder.
By adding templates that override the default ones completely in HivePress/Templates (this doesn’t require code customizations)
Using CSS snippets only (if styling changes are enough), you can keep them in Appearance/Cusotmize/Additional CSS without a child theme, or in the child theme’s style.css file.
So a child theme may not be required depending on the changes.