Home Forums Basel support forum CSS Loading before bootstrap in child theme

CSS Loading before bootstrap in child theme

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #14395

    svaldesm
    Participant

    Hello,

    I’m trying to use a child theme. So far I’ve been using this as reference to make it: https://codex.wordpress.org/Child_Themes

    The main issue is that, if I install the queue in functions.php, as

    
    <?php
    function my_theme_enqueue_styles() {
    
        $parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
    
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array( $parent_style ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    ?>
    

    This causes the CSS load order to be:

    
    theme css
    child theme css
    bootstrap css
    

    which of course is an issue. The right order should be:

    
    bootstrap
    theme css
    child theme css
    

    How can I do this?

    Also, I read in other posts that you can only change the WordPress files, not the ones in the /inc folder. If I want to change those files, what’s the best way to go around?

    Thanks!

    #14400

    Artem Temos
    Keymaster

    Hi,

    You don’t need to create a new child theme. Use already created child theme that comes in the package downloaded from themeforest. If you need to override some functions from inc/ folder then you just need to copy them to the functions.php file in the child theme.

    Regards

Tagged: ,

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