Correct way to implement child theme with xstore? Style problem etc

This topic has 5 replies, 2 voices, and was last updated 7 years, 5 months ago ago by Olga Barlow

  • Avatar: RR123
    RR123
    Participant
    November 8, 2016 at 13:20

    Hello,

    What is the correct way to create a child theme specifically for xstore?

    I have created a child theme with only the below in the functions.php based on https://codex.wordpress.org/Child_Themes. Some styling has gone bad. I wouldn’t be surprised if there is other stuff that my child theme is not pulling in correctly that I have not noticed yet ๐Ÿ™

    Some links (not all) have gone blue based on a bootstrap css file, but most are still the colour specified in the dashboard or custom css dashboard.

    My botton corner radius settings are being undone by the bootstrap css too.

    Very broadly speaking the child is working i.e. it is largely based on my dashboard configuration of xstore and my Custom CSS there, for somethings….

    I am sure this is a simple case of me not implementing my first ever child theme correctly…

    Many thanks,

    R.

     
    <?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' );
    ?>
    
    Please, contact administrator
    for this information.
    4 Answers
    Avatar: RR123
    RR123
    Participant
    November 8, 2016 at 13:32

    login enclosed ๐Ÿ™‚

    Please, contact administrator
    for this information.
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    November 8, 2016 at 14:48

    Hello,

    We have included child theme archive into theme package. Use it to install child theme.

    functions.php of xstore child theme should have the following code at the beginning

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css', array('bootstrap'));
        
    
        if ( is_rtl() ) {
        	wp_enqueue_style( 'rtl-style', get_template_directory_uri() . '/rtl.css');
        }
    
        wp_enqueue_style( 'child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('parent-style', 'bootstrap')
        );
    }

    Regards

    Avatar: RR123
    RR123
    Participant
    November 8, 2016 at 14:57

    Fabulous – thanks Olga

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    November 8, 2016 at 15:09

    You are welcome!

    Regards

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.