Hello. I created a custom post type as ‘real estate’.
And created some custom fields like ‘rooms’ and ‘bathrooms’. I have no problem displaying them on the back end.
I want to display those custom fields on frontend of my custom post type.
How can I do that? I tried some codes but no luck so far.
hii, i am also facing same issue, how can we display custom field data on frontend,
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.