Home › Forums › General Issues › Modify shortcode to display field label? › Reply To: Modify shortcode to display field label?
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
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.