Home>Support>Not supposed to use @import for making a child theme anymore…

Not supposed to use @import for making a child theme anymore…

Hi, folks –

In your answer to my previously posted question, you recommended that I make a child theme before instituting the style change that you gave me. I’ve made a couple child themes in the past, but I am vague about the procedure, so I went to the WordPress Codex for instructions.

The Codex says that best practice for making child themes now involves putting wp_enqueue_script() in the functions.php file instead of importing the parent theme using @import. Urg. I’m really at the limits of my learning curve here. Here’s the Codex page:
http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme

Anyway, I’m trying to piece out how to do this. It appears that Vantage has only one main style.css sheet, so I can probably follow the example that the Codex gives me for enqueueing the parent and child theme stylesheets. What the Codex example doesn’t really spell out, however, is whether I’m supposed to omit the @import command in the child theme’s style.css sheet. I understand that I have to make a style.css AND a functions.php file, and put them both into my theme directory. Hopefully I can remember or figure out how to do that. This is all so marginal for an artist and writer.

Another thing that’s confusing me is whether there is overlap between the “Edit CSS” , “Custom CSS”, and “Editor” tabs on my WordPress dashboard, under “Appearance.” In your previous instructions to me in this support forum, you suggested changing something with the Vantage wrench icon, and then going into “Custom CSS” to change a related thing. That seems straightforward, but do I ever need to use the “Edit CSS” tab for anything? And do I ever need to use the “Editor” to edit my child theme (once I create and activate one)? Or will the stuff I add to the “Custom CSS” tab get automatically added to my child theme?

Thank you so much for help.
Betsy

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Hi Betsy

    You can use @import but you’re right, it’s not best practice.

    Here is a child theme done in the correct method to get you started:

    https://siteorigin.com/wp-content/uploads/2015/01/vantage-child-vanilla-enqueue.zip

    Appearance > Custom CSS can always ben used for adding your own CSS. You can also use the style.css file in your child theme.

    Edit CSS is most likely added by a plugin, either Simple Custom CSS or Jetpack Custom CSS. That’s also safe to use but confusing so I’d turn that off.

    Appearance > Editor shouldn’t be used, unless you’re running a child theme, then you can use Appearance > Editor.

    You only need a child theme if you’re planning on editing theme files at a code level. If you just need to add the odd bit of CSS then I’d recommend sticking with Appearance > Custom CSS. Here is our tutorial on that:

    https://siteorigin.com/basics/modifying-theme-design-with-custom-css/

    Let me know if I’ve missed any questions.

  2. 9 years, 8 months ago Jay Wasack

    When I add a child them, the customizations from the original theme do not seem to come over. Is there something more I need to add to the child theme directory other than creating a style.css and adding the import code (should I decide to use that?)

    I activated the child theme and the site operates properly but the menu colors and structure for starters don’t seem to be working.

    Thanks in advance.

  3. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Unfortunately an expected result of activating a child theme. Customizer settings, menu location settings and widget positions need to be reset.

  4. 9 years, 8 months ago Betsy

    OK, thanks. I’ll just re-think my site design so I don’t need to edit theme files at the code level. It’s too crazy-making to contemplate dealing with all that. Jay Wasack’s question and your answers to me and to him were very helpful.

  5. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    For sure.

    Think of your development process like this:

    1. Theme: use all the options and settings to get your layout as required.

    2. Add plugins for functionality not included with the theme.

    3. Use Custom CSS to tweak what you aren’t able to with the above:
    https://siteorigin.com/basics/modifying-theme-design-with-custom-css/

    4. Only here do we child theme, now we’re editing theme files, adding new page templates etc.

    Ideally stop where you current skill set stops and do what you can with what you know.

  6. 9 years, 6 months ago Anthony

    Thank you so much for providing the link to the functions.php helper file. I am a fairly new customer to your products and it’s comforting to know that you respond to support threads in a timely manner. It makes myself and others more likely to continue to use your products. You and your team rock! Keep up the excellent work.

    • 9 years, 6 months ago Andrew Misplon
      Hi, I Work Here

      Thanks for your support and positive feedback @AMNDeveloper. Glad to hear the starter child theme was useful.

      All the best.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More