Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDeanna Morale
3,773 PointsCan someone please help me. My images are not showing up in wordpress. Ive rebuilt the site twice and still nothing.
My links are correct- even with the bare php files. Everything shows in front-page, header and footer except images. Ive deactivated my functions file as well. My html is correct as: src="images/facts1.png"
..as an example and shows in my regular html. My images folder path is in the theme file. What could possibly be wrong? I'm at my wits end but I don't see the point in moving on if I can't even get the images to show up. Where is ZAC!!!
5 Answers
Kevin Korte
28,149 PointsIs this site public? How are you adding images? In a post body, feature image, another plugin?
Kevin Korte
28,149 PointsIf the images path is correct, they'll show up local. So you've uploaded the images in wordpress via it's media uploader, but you're referencing the images using custom html/php and not any sort of built in WP image helper, correct?
Sounds like your image paths might not be correct. Your image paths would definitely change between your regular site, and the wordpress site.
Deanna Morale
3,773 Pointsi tried uploading via media library and replacing permalink in but still nothing.
Christophe Rudyj
Full Stack JavaScript Techdegree Student 13,011 Pointsin wordpress in a template your images needs to have get_template_uri() because the images are actually stored in /.../wp-content/themes/(insert theme name here)/images/
Christophe Rudyj
Full Stack JavaScript Techdegree Student 13,011 Points <img src="<?php bloginfo('siteurl'); ?>/wp-content/themes/chum/images/social.png" width="50" >
```
this how my img are on my site
Deanna Morale
3,773 PointsIt worked!!! thank you!!:)
Doru Marginean
2,290 PointsYou should use get_template_directory_uri() or get_stylesheet_directory_uri() for child themes.
eg.
<img src="<?php echo get_template_directory_uri(); ?>/images/image.jpg" />
Deanna Morale
3,773 PointsThanks!
Deanna Morale
3,773 PointsDeanna Morale
3,773 PointsIts local. I just inserted the html from a site I already created just regular site into the php and tested it and it all shows and is getting header and footer properly- just no images.. Do the images not show up as a local site?