Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Difference between get_stylesheet_directory_uri() | get_template_directory_uri() | get_stylesheet_uri()
To know the differnce of these 3 function of WP, we need to print this 3 function.
Lets say, Our theme name is "wp-rootstrap". We create a child theme named, "wp-rootstrap-child". Inside child theme, we created header.php
and write the bellow codes to see the results.
<?php echo get_stylesheet_directory_uri() ."<br>"; ?>
<?php echo get_template_directory_uri() ."<br>"; ?>
<?php echo get_stylesheet_uri() ."<br>"; ?>
Result:
http://www.rootstrap.wp/wp-content/themes/wp-rootstrap-child
http://www.rootstrap.wp/wp-content/themes/wp-rootstrap
http://www.rootstrap.wp/wp-content/themes/wp-rootstrap-child/style.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.