Home / Forums / DynamiX Support / Child Theme Questions

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • fscbmwcca
    fscbmwcca
    Participant

    I have successfully created a child theme, So far it contains:

    /* 
    Theme Name: DynamiX Child Theme
    Theme URI: http://themeva.com
    Author: themeva
    Version: 1.0
    Template: DynamiX
    Description: DynamiX WordPress Child Theme
    Author URI: http://themeva.com
    License: GNU General Public License
    License URI: license.txt
    Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, flexible-width, custom-background, custom-colors, custom-header, custom-menu, featured-images, full-width-template, post-formats, rtl-language-support, theme-options, translation-ready, buddypress
    */
    
    @import url("../DynamiX/style.css");

    I noticed that there are other .css files with the theme ( editor-style.css and extra-style.css) should I import those as well?

    In the child theme functions.php I have encluded the following code to try to speed up my site, will this bring in the other styles in?

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

    `

    Andy
    Andy
    Keymaster

    Hi,

    No, they’re not needed for the child theme. One is a dynamic file and the other is for admin only. 🙂

    fscbmwcca
    fscbmwcca
    Participant

    Thanks, Should I remove the other references in the enqueue command?

    This is my first child theme and having some problems. I have a test environment where I took the contents of the custom.css file (the one from jetpack) and put it in my child theme and it works fine. That css primarily creates 2 columns in my wp contact 7 forms.

    When I place the same code in the live site it doesn’t work, i.e. it’s not in 2 columns? I followed the same procedure that I did in the test site (removed the code from custom.css and copy it into the style.css of the child theme). If I inspect element in chrome in the live site where it is not working I can see the div names from the css but it does not render in 2 columns. Then I deleted the code from the style.css from the child theme and pasted it back in the custom.css and it works? I am very confused. Is there an order that they are loaded in? How can the same code work in one spot but not in the other? They both have the same functions.php file.

    Any suggestions?

    Andy
    Andy
    Keymaster

    Hi,

    You shouldn’t need the enqueue script no. As they’re already being loaded.

    Does the custom.css file get overwritten when updating jetpack?

    The same CSS should be able to be placed within the Child > style.css – the Child css acts as an overlay to the original CSS loaded in the core theme. Therefore you don’t need to place into Child > custom.css.

    If you place the CSS from custom.css into Child > style.css and it still doesn’t work, please post a link to your page where the CSS should take affect and what CSS you’re using.

    fscbmwcca
    fscbmwcca
    Participant

    I used the enqueue scripts because when looking at the wp codex and child themes they are moving away from the @import to the enqueue.

    This is the enqueue in my child functions.php

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

    Yes custom.css does get overwritten sometimes (I have a backup).

    I had css code in 3 places and wanted to consolidate so I thought a child theme would be best. So I placed the code from the Theme Options, from custom.css and I also had a plugin that is called Live CSS and placed all of it in the Child theme style.css. I deleted all of the css from the three places and found that it wasn’t working.

    This is the test website where it works: http://fscbmwcca.com/fscbook/contact-us/
    Here is the live site where it doesn’t: http://fscbmwcca.com/contact-us/

    Both sites have the same Child Theme files ( functions.php and style.css). I turned off caching (using WP Super Cache)

    Hope this helps…

    fscbmwcca
    fscbmwcca
    Participant

    Update: I used Child Theme Configurator Plugin and was able to resolve and make this work on the Live Site.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.