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

Displaying Custom Posts and Fields in a Template

Hi Guys, I'm watching the video related to

Displaying Custom Posts and Fields in a Template

Websites > How to Build a WordPress Theme > WordPress Theme Functions> Displaying Custom Posts and Fields in a Template

And I'm lost. I see on the video that he is showing how to display in the work,php page Names of some projects and some descriptions.. Maybe I didn't pay attention but I follow carefully all the videos and I don't remember where we have to add that info to be displayed. Now what he asking on the video is not displaying on the page, and I assume because I never entered that info, I'm completely lost here. Any help please. Thanks

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

He is using the advance custom fields plugin to set up custom fields that you enter the additional information into. Inside of the Custom Fields menu item on the WP dashboard, you set up your field with whatever type of data entry types you need (the ACF plugin gives you quite a few by default). While you're setting up your field, you will have to give it a name.

Let's say you create a custom field called "Project Name" and the slug by default would be "project_name".

Than in your wordpress template, inside of the loop that is caling the post type that is associated with that custom field, you would have something like <?php the_field( 'project_name'); ?> and that will be filled in with the data you put into that field for each post within that post type.

It sounds like you missed a step. I'd recommend you do what I do, and go back re-watch that video. You can easily miss a few things when it is all so new.

Hey Kevin, Thanks. I will have to start all over again.. :( Cant believe I missed a step/ Thanks a lot. Kevin!

Kevin, I half way from re watching the whole thing.. and so far I don't see I have missed something. One thing that make me think that on:

On the project " How to build a WordPress Theme" --> Content Strategy with wordpress --> Adding Custom Content to the Site

at the end of the video he is mentioning to go ahead and download the demo content and start adding it to the site. I'm confuse. where is the link to download that specific content specs? That maybe the issue.. any clue. Somebody... any suggestions? Thanks a lot.

Kevin Korte
Kevin Korte
28,149 Points

I think I answered this just now in your new thread. Let me know!