Home › Forums › General Issues › Get custom post type fields value in theme with code › Reply To: Get custom post type fields value in theme with code
get_field() will only work on the pages of the custom post type. This is more to do with what loops are running on which pages.
You can access those fields a couple ways, by using get_field( ‘field_name’, ‘ID of CPT post’ ) or you can loop through using a wp_query loop and get those fields from that Custom post type.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.