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 trial

WordPress WordPress Theme Development Custom Post Type Templates in WordPress The Portfolio Single Page

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

Image not appearing on single page.

Hi, it seems that something is keeping my images from diasplaying on my single page. I have pretty much ruled out the code in my single-portfolio.php file. I even tried using the single-portfolio.php file from the final-theme folder in the project downloads file and I still got the same result.

Could someone help me troubleshoot this issue? I'm thinking maybe there is an option in dashboard that I'm missing. Below is a screenshot of what I'm getting.

Screenshot

3 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Okay, so based on your having an images field with the name "images_", your source code would need to display an image in the following way:

the_field( 'images_' );

Is that what you have?

I believe in the video we named it "images" without the extra "_" at the end. That is probably why the project files didn't work for you either.

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

That is what I thought but then I tried removing the _ in the AFC settings but nothing changed so I put it back. Let me try changing the code.

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

That did the trick. Apparently I need to get better at trouble shooting. Thank you Zac.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Can you post up a screenshot of what your image field configuration looks like in the ACFs settings as well as confirm that you have images uploaded in the admin area to each post?

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

Here are the screen shots.

This is what my ACFs image field settings look like http://imgur.com/1xAa3WD and http://imgur.com/vj5y8xa

All of my portfolio posts have an image and featured image like this http://imgur.com/u674AUW