Enqueing Directory starter child theme

This topic contains 11 replies, has 3 voices, and was last updated by  cyril lansade 7 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #328029

    cyril lansade
    Expired Member
    Post count: 150

    Hello,

    I use Directory Starter a child theme on a multisite. Any css changes I make I want to go directly into the Child theme style.css file so it is available to all of the network. No matter what I do I can’t seem to get it to work. I’ve read over tons of support forums and I must be missing something fundamental!

    I’ve used something like:

    function example_enqueue_styles() {

    // enqueue parent styles
    wp_enqueue_style(‘directory-starter’, get_template_directory_uri() .’/style.css’);

    // enqueue child styles
    wp_enqueue_style(directory-starter-child’, get_stylesheet_directory_uri() .’/style.css’, array(‘directory-starter’));

    }
    add_action(‘wp_enqueue_scripts’, ‘example_enqueue_styles’);

    But it’s not working! I’m not sure if I am supposed to use the theme name in the code or not. Can you tell me what I am doing wrong

    medrate.asia/sg

    #328030

    cyril lansade
    Expired Member
    Post count: 150
    This reply has been marked as private.
    #328205

    Giri
    Expired Member
    Post count: 3155
    This reply has been marked as private.
    #328247

    cyril lansade
    Expired Member
    Post count: 150
    This reply has been marked as private.
    #328772

    Giri
    Expired Member
    Post count: 3155

    Hi cyril,

    I have modified your child theme’s functions.php file.

    Can you test now and let me know?

    Thanks

    #330930

    cyril lansade
    Expired Member
    Post count: 150

    Hello,

    Hope you had a nice Christmas break.

    It still doesn’t appear to be applying the css in the child theme styles.css doc to the main site: medrate.asia or the subsite: medrate.asia/sg.

    I just added the following as a test that should work on both sites but nothing 🙁

    #primary-nav {
    background-color: red
    }

    #331179

    Paolo
    Site Admin
    Post count: 31206

    I alerted Giri about your question, he’ll let you know asap.

    Thanks for your patience,

    #331571

    Giri
    Expired Member
    Post count: 3155

    Hi Cyril,

    Sorry I have missed your thread yesterday.

    Let me check the problem.

    Thanks

    #331606

    Giri
    Expired Member
    Post count: 3155

    Hi Cyril,

    You seem like using a file called

    function.php

    file instead of

    functions.php

    file in child theme.

    Please rename that file. Hopefully that would fix your issue.

    Thanks

    #332578

    cyril lansade
    Expired Member
    Post count: 150

    Boom! That fixed it. Such a silly error.

    Techy question: if the functions.php wasn’t working due to the miss-spelling how come the child theme worked at all?

    Thank 🙂

    #332636

    Giri
    Expired Member
    Post count: 3155

    Child theme relying on parent theme. You can only have style.css file to make child theme work. You need functions.php file in child theme only if you are planning to add some extra functions.

    Hope that helps.

    Thanks

    #332637

    cyril lansade
    Expired Member
    Post count: 150

    Yup. Brilliant thank you

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket