Child theme

Welcome Forums PavillionWP Child theme

This topic contains 3 replies, has 2 voices, and was last updated by  Brankic1979 5 days, 5 hours ago.

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

    huhh2
    Participant

    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).

    In the meantime I wanted to ask if it would make more sense to release an update for the Pavillion theme with only one stylesheet and manage the options in a different way (e.g. javascript)? Or is there an alternative way of enqueueing the stylesheets when making a child theme that I don’t know about? I expect many people will be making child themes when they purchase this theme, and hand-picking all of the css enqueue statements out of the parent’s functions.php seems pretty tedious.


      Quote
    #6902

    Brankic1979
    Keymaster

    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.


      Quote
    #6904

    huhh2
    Participant

    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.


      Quote
    #6905

    Brankic1979
    Keymaster

    Hi,

    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.


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

You must be logged in to reply to this topic.