In wordpress I try to work with the given syntax template_directory()
for links.
If I use the full path from root directory it works.
$ptthlider_img_second = '/wp/wp-content/themes/theme_name/inc/img/front_slider/slide2.jpg';
My wished goal is to use template_directory
for accessing the jpg
.
$ptthlider_img_first = template_directory() . '/inc/img/front_slider/slide1.jpg';
Do you have any conclusions to assist me here?
Thanks and best regards,
Dennis
2
Answers
use
get_template_directory()
get_template_directory documentationYou can use get_template_directory() as Daniel mentioned.
Good to know:
In addition there is a function get_bloginfo(‘template_directory’) and get_bloginfo(‘stylesheet_directory’), that can also be used for same purposes.