Skip to main content
added 98 characters in body
Source Link
Tom J Nowell
  • 61.6k
  • 7
  • 81
  • 150

get_stylesheet_directoryget_stylesheet_directory_uri is what you want, and if you need. it returns the parentURL of the current theme,. get_template_directoryget_stylesheet_directory. If there is no parent theme then both will return the same valuefile path on the server.

For example:

<img src="<?php echo get_stylesheet_directoryget_stylesheet_directory_uri(); ?>/assets/image.png" /> 

If you need the parent theme, get_template_directory and get_template_directory_uri are the equivalents.

If there is no parent theme then both will return the same value.

Further reading:

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

Further reading:

get_stylesheet_directory_uri is what you want. it returns the URL of the current theme. get_stylesheet_directory will return the file path on the server.

For example:

<img src="<?php echo get_stylesheet_directory_uri(); ?>/assets/image.png" /> 

If you need the parent theme, get_template_directory and get_template_directory_uri are the equivalents.

If there is no parent theme then both will return the same value.

Further reading:

added 98 characters in body
Source Link
Tom J Nowell
  • 61.6k
  • 7
  • 81
  • 150

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

http://codex.wordpress.org/Function_Reference/get_template_directory Further reading:

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

http://codex.wordpress.org/Function_Reference/get_template_directory

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

Further reading:

added 190 characters in body
Source Link
Tom J Nowell
  • 61.6k
  • 7
  • 81
  • 150
get_template_directory(); 

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

http://codex.wordpress.org/Function_Reference/get_template_directory

get_stylesheet_directory is what you want, and if you need the parent theme, get_template_directory. If there is no parent theme then both will return the same value.

echo get_stylesheet_directory(); 

http://codex.wordpress.org/Function_Reference/get_template_directory

Rollback to Revision 1
Source Link
Pieter Goosen
  • 55.5k
  • 23
  • 118
  • 215
Loading
added 2 characters in body
Source Link
Pieter Goosen
  • 55.5k
  • 23
  • 118
  • 215
Loading
Source Link
Tom J Nowell
  • 61.6k
  • 7
  • 81
  • 150
Loading