Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSimone Berzi
5,064 Points@import or a funcition php?
Hello, i read on the codex.wordpress.org that is better use into the style.css in the child theme folder this code: <?php
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); }
than the @import for create the childtheme.
Can someone explame me why?
Thank you :)
1 Answer
Luke Pettway
16,593 PointsIt is better from a performance standpoint, the browser has to load the first style sheet, read it, realizing then that there is a second one to download, which is yet another request.
Here is more on the topic: https://kovshenin.com/2014/child-themes-import/
Simone Berzi
5,064 PointsSimone Berzi
5,064 PointsThank you Luke :)