Home › Forums › Front-end Issues › Hide Div if custom fields are empty › Reply To: Hide Div if custom fields are empty
I have a similar situation. I am trying to display product specifications and details. I have a few blocks created but not every page requires all blocks to be filled out, thus the empty blocks (div) still show up. How can I add a logic to hide the div (frontend: class/borders) if there’s no custom field value entered.
<div class="info-dtl-box" id="additional">
<h4><?php echo $title_additional_block_1; ?></h4>
<ul>
<li><?php echo $description_additional_block_1; ?></li>
</ul>
</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.