I would like to import several styles sheets in my child theme (oceanWP).
I succeed to do it with "@import" method but not with enqueueing scripts and styles.
My child theme uses this "style.css" :
/*
Theme Name: oceanwp-child
Theme URI: https://monsite.com
Description: OceanWP WordPress theme example child theme.
Author: Phil
Author URI: https://voyageinitiartique.com
Template: oceanwp
Version: 1.0.0
*/
/*@import url("./custom/navbar.css"); First, I try to import this with enqueueing method */
@import url("./custom/home.css");
@import url("./custom/voyages.css");
@import url("./custom/concept.css");
@import url("./custom/carnets.css");
@import url("./custom/contact.css");
@import url("./custom/articles.css");`
Child theme function.php :
function oceanwp_child_enqueue_parent_style() {
// Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme)
$theme = wp_get_theme( \'OceanWP\' );
$version = $theme->get( \'Version\' );
// Load the stylesheet
wp_enqueue_style( \'child-style\', get_stylesheet_directory_uri() . \'/style.css\', array (\'oceanwp-style\'), $version );
wp_enqueue_style( \'child-navbar-style\', get_stylesheet_directory_uri() . \'./custom/navbar.css\', array( \'oceanwp-style\' ), $version );
}
add_action( \'wp_enqueue_scripts\', \'oceanwp_child_enqueue_parent_style\' );
Other syntax tried without success:
wp_enqueue_style( \'child-navbar-style\', get_stylesheet_directory_uri() . \'./custom/navbar.css\', array(), \'1.0\', \'all\' );
Is someone can help me ?
Thx !