Move the outer(of the two) div.local_faq
inside the if statement which checks if the faq field is set, because that’s the outer parent container. Also it would make sense to change the outer container div to have a plural div.local_faqs
class instead of the same class as the nested div.local_faq
Then just add the h3 part inside the outer div.local_faqs
and the faqs and header will only show if the field is set:
<?php if (get_field('local_faq')) : ?>
<div class=“local_faqs”>
<h3 class="local_faq" style="text-align: center; font-size: 50px;"><?php the_title(); ?> Dumpster Rental FAQs</h3>
<?php while (the_repeater_field('local_faq')) : ?>
<div class="local_faq" style="margin-left: 100px; margin-right: 100px;">
<h4><?php the_sub_field('question'); ?></h4>
<p><?php the_sub_field('answer'); ?></p>
</div>
<?php endwhile; ?>
</div>
<?php endif; ?>