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 Homepage

Seth Johnson
PLUS
Seth Johnson
Courses Plus Student 8,302 Points

Why doesn't Zac cover "the_field();" here? It would be very helpful in here.

the_field(); allows you to connect your custom fields for this post_type. It seems like it would be a good idea to include that info here.

4 Answers

Seth Johnson
PLUS
Seth Johnson
Courses Plus Student 8,302 Points

I understand that when you are developing a theme for the public marketplace, you want to avoid using the_field(); But, I was trying to abstract the info I needed to use Wordpress as a CMS for my sites.

Zac Gordon
Zac Gordon
Treehouse Guest Teacher

I would only use the_field if your theme says that it requires ACF to work and you auto install and configure it as part of your theme functionality.

Fivvle Divvle
Fivvle Divvle
928 Points

Just have an extra question to this. If i were to put a theme out on public marketplace, would people have to download the plugin, create custom post types and add it into the portfolio-page.php themselves ?

Seth Johnson
Seth Johnson
Courses Plus Student 8,302 Points

Hey Fivvle, Zac has a great answer for this.

"I would only use the_field if your theme says that it requires ACF to work and you auto install and configure it as part of your theme functionality."

He covers why the_field() isn't ideal for themes in the marketplace. But if you were developing a custom wordpress site for a client this is a great way to use WP as a killer (and free) CMS.