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 Make a Website with WordPress Custom Post Types and Fields in WordPress Custom Post Types and Fields Quiz

James Wells
James Wells
2,683 Points

"the_field" answer refers to unrelated plugin in regards to Custom Post Types and Fields in WordPress.

(This is a question that is asked in a quiz in the section "Custom post types and fields in WordPress".)

To display custom fields in the template code, we use the "the_field" function.

This question in the quiz is not clear as it refers to displaying custom fields in a template but the answer "the_field" refers to a function completely external to WordPress in another plugin. I believe the answer to this is question should either be "the_meta" or "get_post_meta".

2 Answers

Andrew Shook
Andrew Shook
31,709 Points

Normally, you would use the two functions you mentioned at the end, however since Zac used ACF plugin the question is still valid.

James Wells
James Wells
2,683 Points

To prevent future confusion for new WordPress developers who are being taught to use custom fields, I would still suggest allowing β€œget_post_meta” or β€œthe_field” at least, as a correct response. ACF does not require "the_field" to be used for outputting custom fields, it is necessary for certain field types, but not all of them.