Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix How to get child theme to have priority of parent theme

Discussion in 'Misc WordPress Requests' started by thomasgardner47, Feb 14, 2018.

  1. thomasgardner47

    Guest

    How to get child theme to have priority of parent theme, by thomasgardner47

    Hello all,

    Below we have provided the functions .php in the child theme

    <?php
    // Queue parent style followed by child/customized style
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', PHP_INT_MAX);
    function theme_enqueue_styles() {
    wp_enqueue_style( 'sydney-pro-ii', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'sydney-pro-ii-child', get_stylesheet_directory_uri() . '/style.css', array( 'sydney-pro-ii' ) );
    wp_enqueue_style( 'sydney-pro-ii-child-tom', get_stylesheet_directory_uri() . '/tom.css' );
    ?>

    The priorities work fine but the functions code that you can see above is being loaded in twice, how would we go about fixing this?

    Many thanks
    Tom

    How to get child theme to have priority of parent theme
     
    #1

Share This Page

Monarch Social Sharing Plugin