Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Skarr

    (@skarr)

    Just thought posting the whole code for my child theme is more helpful.
    derived from parent-style = twentyfifteen-style, and my child theme is child-style = zlabiya-style

    /* load the styles and overrides */
    function zlabiya_enqueue_styles() {
        wp_enqueue_style( 'twentyfifteen-style', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'zlabiya-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('twentyfifteen-style')
        );
    }
    add_action( 'wp_enqueue_scripts', 'zlabiya_enqueue_styles' );

    Skarr

    (@skarr)

    The problem here is really that the codex entry need a proper clean up. The examples there are really generic, while the text refers to twentyfifteen. You are supposed to replace textually 'parent-style' and 'child-style' by their proper name for it to work.

    If I derive a child theme from twentyfifteen, the code is
    wp_enqueue_style( 'twentyfifteen-style', get_template_directory_uri().'/style.css' ); and NOT

    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );

    This is, imho, the proper and intended way of using scripts and styles enqueuing.

    Using wp_deregister_style, while it works, is overkill.

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