• sneed

    (@sneed)


    I created a child theme and used the @import code in my style.css. I’m trying to update to the method using the enqueue in the funtions php.
    My style.css code is:

    /*
    Theme Name: unite child theme-not important
    Theme URI: https://cavasenostudios.com/ -not important
    Description: unite child theme-not important
    Author: Stephen Cavaseno-not important
    Author URI: https://cavasenostudios.com/ -not important
    Template: unite
    Version: 1.0-not important
    */

    and my functions.php code is:

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘unite_child_enqueue_styles’, 11 );
    function unite_child_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );
    }
    ?>

    When I upload these files to the site, I lose lots of formatting.
    So 1st, what is wrong and 2nd, when I originally added all the custom formatting, where is that code saved?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Silkalns

    (@silkalns)

    Instead of using wp_enqueue_style use @import function via Child Theme style.css.

    This theme uses Bootstrap so wp_enqueue_style will load stylesheet on the wrong order and theme will look strange. @import on the other hand will work perfectly fine with this theme.

    Let me know if this helps.

    Thread Starter sneed

    (@sneed)

    Everything I read said that the @import function was no longer used. I switched to enqueue and everything seems to working properly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Updating Child Theme to Enqueue form @Import’ is closed to new replies.