Support

Account

Home Forums General Issues Conditional select field

Helping

Conditional select field

  • Hi,

    I’m trying to create a conditional selection field. I would say the problem is that it is within a group, when the pull of the group works properly

    This works:

    <?php
    	$group = get_field('group');
    	$field = $group['field'];
    	if( $field ) { ?>
    		<p>My text</p>
    <?php } ?>

    But when I put a conditional, it doesn’t work :

    <?php
    	$group = get_field('group');
    	$field = $group['field'];
    	if( $field == 'field1' ) { ?>
    		<p>My text</p>
    <?php } ?>

    Any solution?
    Thanks!

  • Need more information. What is the name of the field and the sub fields? What type of fields? What can the values be?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.