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:
- https://codex.wordpress.org/Function_Reference/get_stylesheet_directory
get_stylesheet_directory- absolute folder path of current theme
- e.g.
/var/www/yoursite/wp-content/themes/child_theme
- https://codex.wordpress.org/Function_Reference/get_template_directory
get_template_directory- absolute folder path of parent theme
- e.g.
/var/www/yoursite/wp-content/themes/parent_theme
get_stylesheet_directory_uri- full URL of current theme
- e.g.
https://example.com/wp-content/themes/child_theme
get_template_directory_uri- full URL of parent theme
- e.g.
https://example.com/wp-content/themes/parent_theme