All directory tags in wordpress, help
-
In wordpress there are quite a lot of different “directory” functions. Can someone help me understand when to use which? Fx, the
get_template_directory_url(); specifies a URL while
get_template_directory; specifies a Server path? What exactly is the difference? if the server is running on the web, then don’t they both locate files in the wordpress server directory?Accordign to wordpress codex: get_template_directory_url(); this returns a properly-formed URI; in other words, it will be a web-address (starting with https:// or https:// for SSL). As such, it is most appropriately used for links, referencing additional stylesheets, or probably most commonly, images.
get_template_directory
Returns an absolute server path (eg: /home/user/public_html/wp-content/themes/my_theme), not a URI.Complete list
get_template_directory();
get_template_directory_url();
get_Stylesheet_url();
bloginfo(‘template_directory’);
bloginfo(‘template_url’);
bloginfo(‘stylesheet_directory’);
bloginfo(‘stylesheet_url’);
- The topic ‘All directory tags in wordpress, help’ is closed to new replies.