Hi. I’m so sorry for being unclear with my question.
In my first attempt i could get the field label to display with $field_name = “sz_employee_experience”; in the shortcode code in functions.php not in the schortcode in the text editor [acf-headline field=”sz_employee_experience”] just printed the value of the field not the field label.
Now with your last code it works perfect! $field_object = get_field_object($field); was the thing I was after.
Thanks a lot for being so patient and sticking by when I was so unclear.
Regards
Olle
Hi
Ok, but I have tested a plugin “Custom Content Shortcode”
And with that I can set the fields field name in the shortcode like so [field field_name out=field-label]
Much more convenient than hardcode the field name in the functions.php
I can go with that plugin. But I’d rather not if it’s possible without another plugin.
Regards
Olle