• I have 4 ACF fields: contact1_first_name, contact1_last_name, contact1_title, contact1_email.

    I am able to display these using the following:
    [field key=contact1_first_name] [field key=contact1_last_name], [field key=contact1_title], [field key=contact1_email]

    I would like to take the next step and conditionally display title and email (with associated comma) only if I have this data. How can I do this?

    Thanks very much.

Viewing 1 replies (of 1 total)
  • [if not field=contact1_email]
    No email supplied
    [else]
    [field key=contact1_email]
    [/if]

    or

    [if field=contact1_email]
    Email: [field contact1_email]
    [/if]

    check out [if exists] as well, I believe it is used to check if the actual field is even present on the post, rather to check the value

    find the docs under /wp-admin/options-general.php?page=ccs_reference&tab=if

Viewing 1 replies (of 1 total)
  • The topic ‘Conditional logic with ACF fields’ is closed to new replies.