[Resolved] Child Theme Performance

Home Forums Support [Resolved] Child Theme Performance

Home Forums Support Child Theme Performance

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #882644
    Dean

    Hi Tom.

    Been told to post this here.

    I have some questions about performance and child themes.

    Currently the way I use GenPress is to create a new website using GenPress on localhost. Once I am happy with the design, I then create a child theme and copy the settings from the customiser into PHP.

    The end result is like your child themes Statement, Freelancer, Mantle etc on the WordPress repository. All the customiser settings are in the functions.php file.

    So my questions are:

    1) Which method is better for performance? Creating a child theme using PHP options like I currently do, or just entering and saving the settings in the customiser? I am unsure as I would of thought by using PHP it avoids GP having to get the options from MySQL database, but then you also have some “Cache dynamic CSS” system going on.

    2) Do you have a complete list of all the functions and variables? Something like this (https://generatepress.com/forums/topic/how-can-i-create-a-child-theme-that-comprehends-customizer-settings/)? I have my own, but I think it is probably out of date now.

    3) Do you have any further tips regarding making child themes?

    Thank you.

    Kind regards,
    Dean

    #883377
    Tom
    Lead Developer
    Lead Developer

    Hey Dean,

    1. I doubt there is much of a difference. We put our options into a variable, and when we define that variable, we add the defaults as a fallback if no option exists.

    What you’re doing is setting the defaults, then WP checks for the option and uses the default if no value exists in the database.

    Performance-wise, I wouldn’t choose one over the other.

    2. We don’t have a complete list, but we should. We’ll try to get that added to the docs soon. In each of the modules, you’ll find a function which defines all of the defaults – usually near the top of the main functions file, or in a defaults.php file.

    3. Use filters and hooks where possible instead of overwriting entire functions/template files. Other than that, there’s not much else to do when it comes to child themes.

    Hope this helps! 🙂

    #1256945
    Anonymous

    Hi Tom,

    To clarify, is there a performance impact when using the child theme?

    If yes, when does this occur and what are the options to optimize the degradation if any?

    #1257014
    Tom
    Lead Developer
    Lead Developer

    A child theme adds an additional style.css file to your site, but that’s the only difference performance-wise that it will make.

    #1257056
    Anonymous

    Thanks Tom. Is the difference in using the child theme/functions.php measurable or is it negligible? For example, do the additional functions have a negative impact to the overall performance?

    #1257609
    David
    Staff
    Customer Support

    Hi there,

    in comparison to adding Functions using a plugin – i can’t see there being any performance differences.

    #1258426
    Anonymous

    Thanks David.

    #1259124
    David
    Staff
    Customer Support

    Glad we could be of help

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.