function wpdocs_style() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() ); //This is for getting style.css of current theme
wp_enqueue_style( 'style-name1', get_teplate_directory_uri() . '/css/custom.css', array('jquery') ); //This is for getting other css file from parent directory
wp_enqueue_script( 'script-name1', get_teplate_directory_uri() . '/js/custom.js', array('jquery') ); //This is for getting JS file from parent directory
}
add_action( 'wp_enqueue_scripts', 'wpdocs_style' );
OR
//Or as an laternate you can hook with wp_head also
add_action( 'wp_head', 'wpdocs_style' );
In order to run the above function need to add <?php wp_enqueue_script("jquery"); ?>
(If you use this action add_action( 'wp_enqueue_scripts', 'wpdocs_style' );
) in header.php
befor </head>
.
You have to assign name to every style (like I assign style-name, style-name1 etc) and name should be unique.
And if you want to qnqueue from child theme's functions.php then you have to use get_stylesheet_directory_uri()
instead of get_teplate_directory_uri()
.