How to get all specific fields from one ACF Group?

Question

I have created few question/ answers using ACF.

Field names are question_1, question_2 and so on.

My codes are:

<?php if (get_field('question_1') == 'yes') && (get_field('question_2') == 'yes'):?>
Answer: Yes
<?php:?>
Answer: No
<?php endif; ?>

How to limit code repetition, if I have 100 questions in number, I just want to avoid using

get_field('question_1') == 'yes' to get_field('question_100') == 'yes'

0
Ricky 2 months 2022-10-03T05:28:27-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse