October 9, 2017 at 12:31 pm #6898
I would like to create a child-theme for my client, but I’m having some problems. As far as I understand, there is usually a single stylesheet in the parent theme that should be enqueued by the functions.php file in the child theme, before the child theme’s own css file is enqueued. However, the Pavillion theme has a lot of css themes that are sometimes included and sometimes not, depending on a series of options that are handled via php if statements. I don’t know if this php code would break if they’re in the child functions.php as opposed to the parent functions.php (in my first try, it did, but I may have done something wrong, so I’m looking at this right now).
huhh2QuoteOctober 11, 2017 at 10:30 am #6902
As I understand child themes, all stylesheets (and all other files) from the parent theme are included by default into child theme.
So, if you want to change something, you have to copy that file to the same location in child theme, and that new file will replace original file from the parent theme.
Different options shouldn’t break anything (in theory).
We’ve used the same approach in our best selling theme (more than 10K sales) https://themeforest.net/item/bigbang-responsive-wordpress-template/2826493 and there was no issues with child theme mentioned.
Brankic1979QuoteOctober 18, 2017 at 10:57 am #6904
I found that copying all the css enqueue statements including their surrounding php statements into the child theme’s functions.php file works fine.
I have another question though, regarding the portfolio styles. The single-portfolio_style_1 through 10 are located in the shortcodes plugin, but I’m not sure why they should be there. I would like to edit one of them to fit my own design, but in this case that means I have to edit the plugin files directly, or make a ‘child plugin’, which isn’t standard wordpress practice as far as I know. Why aren’t these php files in the theme folder? Then I could simply copy that structure to my child theme and change whatever I want.
huhh2QuoteOctober 18, 2017 at 10:32 pm #6905
great question, but you should ask ThemeForest crew.
In our first version, these files (custom post type) were in the theme folder, but they said it’s a plugin area, and they have to be in the plugin.
I know that some older themes (still active and with very good sales) have similar files in theme folder, but last year ThemeForest made some changes in theme submission rules, so only way is to put all custom layout files in plugin.
You must be logged in to reply to this topic.