1

I know this is a frequently asked question but I don't resolve it.

I have make a child theme of a theme with multiple css file and I'm trying to copy them but I probably don't enqueues css files correctly. I have tried multiple functions found on the web The 3 parent css files are style.css, editor-style.css, style.less.css and they are directy on the parent directory (no sub directories). I have called my different functions with more "s" to have different names :

function wpm_enqueue_styles(){
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'editor-style', get_template_directory_uri() . '/editor-style.css' );
wp_enqueue_style( 'less-style', get_template_directory_uri() . '/style.less.css' );
}
add_action( 'wp_enqueue_scripts', 'wpm_enqueue_styles' );

function theme_enqueue_styles() {

    $parent_style = 'parent-style';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        get_stylesheet_directory_uri() . '/editor-style.css',
        get_stylesheet_directory_uri() . '/style-less.css',
        array( $parent_style )      
    );
}
add_action( 'wp_enqueue_scriptss', 'theme_enqueue_styles' );

add_action( 'wp_enqueue_scriptsss', 'wpse179217_enqueue_styles' );
function wpse179217_enqueue_styles() {
  wp_enqueue_style( 'parent_name-style', get_template_directory_uri() . '/style.css' );
  wp_enqueue_style( 'parent_name-odometerstyle', get_template_directory_uri() . '/editor-style.css', array(), '' );
  wp_enqueue_style( 'parent_name-animate', get_template_directory_uri() . '/style-less.css', array(), '1.0' );
  wp_enqueue_style( 'child_name-style', get_stylesheet_uri(), array( 'parent_name-style' ) );
}

Tkanks in advance

  • 1
    why do you need to enqueue scripts 3 times?? – terminator Feb 10 '16 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.