Home › Forums › Front-end Issues › how to display custom fields on custom post type? › Reply To: how to display custom fields on custom post type?
You simply need to add the code to your theme template.
For example:
$value = get_field( 'my_field' );
if($value):
echo $value;
endif;
Just change my_field to the name of your custom field.
Depending on your theme or where you want the code, you may need to use:
$value = get_field( 'my_field', $post_id );
Maybe share your code and we can see what you have and help a little more.
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.