0

How can I combine the two if statements below, but I would like the page to display the breadcrumbs if one OR the other fields are present.

<?php if (!empty($secondaryslider)): ?>
<?php if (!empty($node->field_upload_banner[0]['view'])) {?>

3 Answers 3

2

Use || or OR

if (!empty($secondaryslider) || !empty($node->field_upload_banner[0]['view']))
{
}
Sign up to request clarification or add additional context in comments.

Comments

1

Just use an ||:

<?php if ( !empty($secondaryslider) || !empty($node->field_upload_banner[0]['view']) ): ?>

1 Comment

Edited after you specified you wanted one OR the other
0

very straight forward

<?php if (!empty($secondaryslider) && !empty($node->field_upload_banner[0]['view'])): ?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.