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

Get a value to Text Feild Text of Advanced Custom Feild Plugin

hi, I used Advanced Custom Feild Plugin to create a Text Feild call "Author Name" and "Location". How can I get default value in Author Name Feild = First name + Last name and Location Feild = Address ( address when user register )?

Rgds, Tommy.

1 Answer

Ryan Cates
Ryan Cates
18,344 Points

This will return the value for the field "Author Name"; assuming your field name is "author_name"

<p><?php the_field('author_name'); ?></p>

This will return the value for the field "Location"; assuming your field name is "location"

<p><?php the_field('location'); ?></p>

ACF

Also you don't really need the paragraph tags... you could also use h1-h6 or whatever text element you want.