I am using a child theme but it does not display any images. I am reading a book which suggests the following: “There is a difference in calling images from parent themes and child themes:
for parent Theme:
<?php echo get template_directory_uri(); ?>
for child Theme:
<?php bloginfo('stylesheet_directory'); ?>
Unfortunately the book doesn’t say where the relevant code should be inserted.
Any ideas please.
2 Answers
You could try the following if you have a child theme and trying to reference your images from that file location, onto your custom .php files…
<img src="https://wordpress.stackexchange.com/questions/226211/<?php echo get_stylesheet_directory_uri(); ?>/assets/images/your-custom-image.jpg" />
Just make sure in your child theme location, you really have a child folder structure of…
assets -> images