Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abid112/6f566a80f0283b5c529b7c4c0868bec7 to your computer and use it in GitHub Desktop.
Save abid112/6f566a80f0283b5c529b7c4c0868bec7 to your computer and use it in GitHub Desktop.
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