Answer the question
In order to leave comments, you need to log in
Code to output custom ACF fields?
Please tell me how to write the code correctly and implement the output of arbitrary ACF fields. If the custom field acf mobile is active, then display only custom fields acf 1,2,3,4 for mobile devices, and only custom field acf 5 for computers. If custom field acf mobile is not active, then display only acf 1 fields for all devices ,2,3,4, and do not output any field acf 5 at all.
<?php if ( get_field('mobile') ): ?>
<?php if(wp_is_mobile()) { ?>
<?php произвольное поле acf 1 ?>
<?php произвольное поле acf 2 ?>
<?php произвольное поле acf 3 ?>
<?php произвольное поле acf 4 ?>
<?php } else { ?>
<?php произвольное поле acf 5 ?>
<?php } ?>
<?php endif; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question