mercredi 5 août 2020

PHP - If Else Statement not triggering to change banner based on Events Calendar Event

A client wants to change the banner of her site based on the Events Calendar Event. The url for the event is "/event/the-intersection-of-gender-racial-equality/" I figured I'd do an if else statement but right now the banner is not changing and is only coming back with the last ELSE banner image with the tag. Any help would be greatly appreciated. Thank you!

<?php if (!get_field('header_image')): ?>
<div class="item" style="background-image: url('<?php bloginfo('template_url'); ?>/assets/images/default-header.jpg');">
</div>
<?php elseif(is_single( 'The Intersection of Gender & Racial Equality' )): ?>
<div class="item" style="background-image: url('<?php bloginfo('template_url'); ?>/wp-
content/uploads/2020/08/WBDC_EventPage_GenderRacialEquality_Banner.jpg');">
</div>
<?php else: ?>
<a href="https://www.wbdc.org/wbdc-is-working-remotely-2/"><div class="item" style="background-image:
url('<?php echo get_field('header_image'); ?>');">
</div></a>

Aucun commentaire:

Enregistrer un commentaire