From the course: WordPress: Advanced Custom Fields

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Multiple rules for displaying fields

Multiple rules for displaying fields - WordPress Tutorial

From the course: WordPress: Advanced Custom Fields

Start my 1-month free trial

Multiple rules for displaying fields

- [Narrator] The way our field group is currently set up, it will show up on every post edit screen, even thought we're only really using it for information on profiles, not all posts. That also means that if we're hiding the content editor, it's going to do it across all posts, even if we want to create a standard news or blog article. Luckily, ACF allows us to control that through powerful conditionals for displaying the fields. Lets take a look. We'll go to custom fields field groups, and then we'll go to profile info. Under location, you see the settings that we've set up previously. Specifically if a post type is equal to post, display our field group. But you'll notice that there are ways for us to add multiple conditions. And we can add a logical OR, or a logical AND. The difference is that with a logical OR, any conditional can be met for the fields to show up. With a logical AND, every condition must be met for the fields to show up. You would use OR if you wanted the fields…

Contents