Support

Account

Home Forums General Issues Hide if empty

Helping

Hide if empty

  • I have 2 different fields in different classes, which are displayed on the site in one section. Only one of them is used at a time.

    I am currently using this code:

    <div class = “class2”>
    <? php the_sub_field (‘filed2’); ?>
    </div>
    <div class = “class1”>
    <? php the_sub_field (‘filed1’); ?>
    </div>
    Each has a different class, but both options are available. I want to make a condition. If filed2 is used then class 2 And if filed1 is used then class 1

    Right now the style of both is conflicting, and it doesn’t fit. How to define this condition?

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

The topic ‘Hide if empty’ is closed to new replies.