In the WPDevDesign Facebook group, a user asks:

What I’m trying to accomplish is very simple: I made a repeater for team members. The block includes a text field for the bio but this should only show if there is content coming from dynamic data: repeater field => field => bio. The text field has a margin of 20px and underneath there is link-wrapper to the email. So if there is no content for the bio, the text field shouldn’t show up at all to avoid the extra margin spacing.

So my question is: how should I set the conditional to achieve this?

This tutorial for Oxygen provides the steps to output a Advanced Custom Fields’ Repeater-type of field’s sub field value only if that (or any other – if you want) sub field is populated.

Step 1

In the Oxygen editor select your Repeater component and within that, your sub field (in this example, “Bio”).

Step 2

Click on Condition Settings icon and then Set Conditions button.

Step 3

Select Dynamic Data condition.

Step 4

Click on Repeater Field under Post.

Step 5

Select your sub field and click INSERT.

Step 6

Select is_not_blank as the operator.

and that’s it!

Now the custom field will only get output on the frontend if the selected field has a value.

Need help implementing a tutorial in your site or want to hire me for custom work?

HIRE ME

Find the article helpful and wish to donate?

DONATE

Comments

For adding code blocks wrap the code in three backticks. Markdown should work.
Provide a URL of your site/webpage if something is not working.
magnifiercross
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram
%d bloggers like this: