How to include image path to background-image in WordPress correctly? Cause this isn’t working for me
<div class="slide" style="background-image: url("<php bloginfo('template_url'); ?> /assets/img/slide1.jpg");">
How to include image path to background-image in WordPress correctly? Cause this isn’t working for me
<div class="slide" style="background-image: url("<php bloginfo('template_url'); ?> /assets/img/slide1.jpg");">
2
Answers
Are you sure u didn’t mess with your theme options? because that thing should just work. Check the documentation: https://developer.wordpress.org/reference/functions/bloginfo/
It is noted to use
get_template_directory_uri()
instead for the parent template directory orget_stylesheet_directory_uri()
for the child template directoryYou are trying it in a wrong way. Reference : Check Here
Replace your code with: