Necessary child theme file set-up.

resolved (19 posts) (8 voices)

  1. olindacat

    I have spent the past few days working on a site using Modular and am realizing that it is probably a good idea to have a child theme schema as opposed to just editing theme files, or is this wrong?

    Should I child this theme now? Is it too late? I have only changed the background image, and used the theme's own dashboard/control panel to configure so far.

    I have had child themes that didn't 'take' changes to the styles.css file, and others, and I know there are many reasons why that are beyond my skill level.

    So, should I child this, if so, what are the best files to create for the child? Like, for example, the header.php? I want to modify this, as an example. (Sorry if this seems nobbish.)

    Posted 5 years ago #
  2. Elliott

    Hello olindacat,

    A child theme is a smart idea. See here,

    Posted 5 years ago #
  3. olindacat

    Hi Elliot,

    Is it too late to make one? (I have made 'some' mods but not many. Will it complicate things or will everything still work normally? Which files should I create? I am using 'blue.css' skin with a BG image.

    Thanks for doing such a good job supporting this site.


    Posted 5 years ago #
  4. olindacat

    Never mind. That was a very helpful article. Thanks, Elliot.

    Posted 5 years ago #
  5. Hi John,

    Let us know if you need anything else!


    Posted 5 years ago #
  6. bynatasha


    I created a child theme for method. Here's my top text:

    Theme Name: Method Child
    Theme URI:
    Author URI:
    Template: method
    Version: 1.8

    @import url('../method/style.css');

    The problem is that my child theme is overwritten by the original style.css!

    Did I make something wrong?

    Posted 5 years ago #
  7. Elliott

    If you add CSS to the child theme stylesheet then it will be displayed at the very end so it should be overriding the parent stylesheets.

    You can also use the !important rule to override any CSS.

    Posted 5 years ago #
  8. bynatasha

    I have added my CSS. That's the reason I'm saying it's overwritten.

    That means that I'll have to use !important to all my code. Is that normal?

    Posted 5 years ago #
  9. Elliott

    It depends on the CSS but yes it's fine to use.

    Posted 5 years ago #
  10. Is there any way you can make a child theme fully functional withouth having to select and activate a customized style in the theme options panel?

    I have a MrMasterKey child theme, but at the moment I still upload a MrMasterKey.css file to the [parent_theme]/styles folder and activate it. Would love to do without it.

    Any hints, Elliott or Rochester?



    Posted 4 years ago #
  11. Elliott

    No, not that I know of. I would try asking here,, to see if anyone has done that before.

    Posted 4 years ago #
  12. Hi Elliott,

    I'm puzzled. Why ask at WP support, when it is a clear MSMW framework issue .- at least in my view. If I activate a child theme, any CSS file in the child theme folder should overwrite the settings given in the parent folder. Isn't the whole point of a child theme that you keep the parent clean of any modifications? Just wondering, and perhaps this could be built into a future version of the framework with relative ease.



    Posted 4 years ago #
  13. Elliott

    If you add the CSS in the child theme style.css file then yes it should. Just adding extra stylesheets in the child theme folder is not going to do anything unless you import them in the main style.css file.

    And make sure to add them below the line where you import the parent theme stylesheet.

    Posted 4 years ago #
  14. AskYvi

    I followed your instructions for childthemes but adapted WP's new recomendation to not use @import but use:

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );


    and in my awake-childtheme no changes are being displayed?! No matter if I change something in the skin or costum css, it doe not update.

    Any help would be appreciated

    Posted 2 years ago #
  15. I'm moving to the new enqueue way for child themes, too, and would love to know he response to AskYvi's question.

    Posted 2 years ago #
  16. water-works

    I am also looking to build a child theme. I'm going to be using Wordpress' recommendation for enqueue and avoid the @import which is no longer considered good practice.

    Posted 2 years ago #
  17. water-works

    No response on this yet? Still looking to get child theme working.

    Important to note:
    Using the @import is suggested by MSMW

    However, using @import is no longer suggested by Wordpress

    "The final step is to enqueue the parent and child theme stylesheets. Note that the previous method was to import the parent theme stylesheet using @import: this is no longer best practice. The correct method of enqueuing the parent theme stylesheet is to add a wp_enqueue_scripts action and use wp_enqueue_style() in your child theme's functions.php. You will therefore need to create a functions.php in your child theme directory."

    Wordpress also states:
    "The following example function will only work if your Parent Theme uses only one main style.css to hold all of the css. If your theme has more than one .css file (eg. ie.css, style.css, main.css) then you will have to make sure to maintain all of the Parent Theme dependencies."

    MSMW themes typically use multiple style sheets since it's possible to create a custom CSS sheet within the admin area for the theme. Then how do we set up our functions.php to make sure we maintain all of the Parent Theme dependencies as Wordpress suggests?

    Child theme with multiple dependencies:

    Further discussion and solutions for child theme with multiple dependencies:

    Perhaps MSMW can update their suggestions for how to build a child theme properly using Wordpress' most recent best practices rules for child themes. Thanks. :)

    Posted 2 years ago #
  18. water-works

    Update. I got my child theme to work for Dejavu theme, after much internet searching. The following is the code for my functions.php. Note, this works for adding custom css styles. I have not yet tried making edits to theme files such as header.php, footer.php etc.

    Creating child theme edits for framework.php.

    Redeclaring functions

    function use_parent_theme_stylesheet() {
        // Use the parent theme's stylesheet
        return get_template_directory_uri() . '/style.css';
    function my_theme_styles() {
        $themeVersion = wp_get_theme()->get('Version');
        // Enqueue our style.css with our own version
        wp_enqueue_style('child-theme-style', get_stylesheet_directory_uri() . '/style.css',
            array(), $themeVersion);
    // Filter get_stylesheet_uri() to return the parent theme's stylesheet
    add_filter('stylesheet_uri', 'use_parent_theme_stylesheet');
    // Enqueue this theme's scripts and styles (after parent theme)
    add_action('wp_enqueue_scripts', 'my_theme_styles', 20);

    Explanation of functions.php code shown above

    Explanation/debate on including a closing php tag for functions.php

    Posted 2 years ago #
  19. water-works

    Update. The above code seems to work perfectly for child theme for theme Dejavu. I have not tested it out with other themes as I have purchased only the the Awake and Dejavu themes.

    If you're stuck on how to make edits to theme files within your child theme, I followed the rules provided by MSMW regarding redeclaring functions.

    Redeclaring Functions

    Important to note is that a lot of code happens within the /[theme-name]/lib/functions/theme.php file. Quite often if you want to make edits to the theme, you'll need to cut-and-paste code from the theme.php to your /[theme-name]-child/functions.php. Be sure to place the cut-and-pasted code after the initial code to enqueue style sheets. Then edit the code within your /[theme-name]-child/functions.php to do what you want it to do and it will override original function located at /[theme-name]/lib/functions/theme.php.

    Hopefully this helps someone else who might be stuck on child themes for Dejavu or the other themes.

    Posted 2 years ago #


You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme