LAM: Notes for child theme

Adding CSS files in child theme functions.php

add_action( 'wp_enqueue_scripts', 'myAddedCssFiles' );
function myAddedCssFiles() {
	wp_enqueue_style(
		'1AddedCss', get_template_directory_uri() . '/your-first-css-file.css', array( $parentStyle ), wp_get_theme()->get('Version') );
		'2AddedCss', get_template_directory_uri() . '/your-second-css-file.css', array( $parentStyle ), wp_get_theme()->get('Version') );
		/* copy and paste as many times as your css files 
		....
		....
		*/
		'lastAddedCss', get_template_directory_uri() . '/last-css-file.css', array( $parentStyle ), wp_get_theme()->get('Version') );
	}

Leave a Comment