wordpress - Function theme_enqueue_styles() for child css -


my folder child themes composed of file 'style.css' , 'functions.php' in functions.php file can not access function theme_enqueue_styles() use custom css

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

for child theme, need replace get_template_directory_uri() get_stylesheet_directory_uri().

the code should be:.

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() {   wp_enqueue_style( 'parent-style', get_stylesheet_directory_uri() .'/style.css' ); } 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -