Home Forums General Issues Hide if empty


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 class = “class1”>
    <? php the_sub_field (‘filed1’); ?>
    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)

You must be logged in to reply to this topic.