child .css

  • Unknown's avatar

    hi . i successfully created a child theme . The .css file didnt work in the editor ( although the .css in ‘additional css’ on the child template dashboard works fine. Also i could see the .css file on my editor was linked because i could see changes i made to e.g. the author name , took affect in the template information area.

    After reading about loading the css in correct order with a enqueue function:
    https://codex.wordpress.org/Child_Themes

    it didnt work but when i changed the code from parent style to child style like this before and after :
    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    function my_theme_enqueue_styles() {
    wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ );

    }

    to this

    add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );
    function my_theme_enqueue_styles() {
    wp_enqueue_style( ‘child-style’, get_template_directory_uri() . ‘/style.css’ );

    }

    it worked!… even though there is a ton of code ive not had to use from the tuts… just by changing the name of the parent to child…..

    will this cause problems later on or should this work ok? thx

    The blog I need help with is: (visible only to logged in users)

  • Hi there,

    Looks like you’re in the wrong forum. It appears that you’re using the self-hosted version of WordPress and you need to seek help at the WordPress.org forums:

    https://wordpress.org/support/

    These forums are for WordPress.com hosted sites only. If you want to know more about the differences between WordPress.com and WordPress.org you can read this document:

    WordPress.com vs. WordPress.org

  • The topic ‘child .css’ is closed to new replies.