Reputation: 103
i am using CPT UI for custom post type and ACF custom fields. i have created custom post type (companies) and linked to its custom fields. In admin everything is okay. I want to display this in front end. The user can be enter the company details also. How can i display this in front end ?
Upvotes: 0
Views: 259
Reputation: 417
<?php
$id = get_the_ID();
$data = get_field('custom_field_name', $id);
echo $data;
?>
Obviously this will need a lot of refinement to look good but that's the basics on how to retrieve data from an ACF field. You may need to var_dump($data);
in order to figure out how to get the part you want (if it's not just storing a string). Without more details on what you're doing that's a good an answer as I can give you.
Upvotes: 0