Home › Forums › General Issues › Shortcode: Using the Hide if empty in a shortcode › Reply To: Shortcode: Using the Hide if empty in a shortcode
John, if not incorporating all options into acf standard shortcode
[acf field="field_name" post_id="options" hide_empty="1" html_tag="div" class="my-class"]
Then create another shortcode acf_html for adding the html
[acf_html field="field_name" post_id="options" hide_empty="1" html_tag="div" class="my-class"]
Would output:
<div class="my-class">Field Value</div>
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.