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

How to Build Wordpress Themes : Level 3. The video, "Displaying Custom Posts and Fields in a Template"

I am not sure how the content "Stop Visual Pollution", "Dr. Waltz", "Smells Like Bakin", and "Shirts 4 Mike" is populated within WP and the PHP.

Here is a screen shot: http://cl.ly/image/3Z2p2Y0B3G0W

My rendered file is not displaying this.

1 Answer

Andrew McCormick
Andrew McCormick
17,730 Points

make sure that you are calling wp_query and you are using the correct the_field() function with parameters. the_field() is how that bit of content you mentioned is being displayed.

Here is a screen shot:

http://cl.ly/image/1C0B2N0T1m3h

I am using wp_query and I use the_field. Why do we pass the arg 'description' into into the_field ('description') and there is no arg being passed into the_title( )? I checked my custom fields in WP and this is the 'Work' group of custom fields for WP. There isn't any field called title. I went back in the video to see if I missed a step somewhere and could not find anything.

<h3><a href="<?php the_permalink() ;?>"><?php the_title() ;?></a></h3>
<?php the_field( 'description' ); ?> <hr>

Thank you.