Support

Account

Home Forums ACF PRO Image not displaying from array first time but it is the second time (same code)

Unread

Image not displaying from array first time but it is the second time (same code)

  • Hi

    I have the following groups and fields. The second group displays the background image absolutely fine but the first does not. WHY!!! Driving me crazy.

    
    <?php if( $highlightboxone ): ?>
      <div style="background: linear-gradient(0deg, rgba(102, 102, 102, 0.45), rgba(102, 102, 102, 0.45)), url(<?php echo esc_url( $highlightboxone['background_image']['url'] ); ?>) no-repeat center / cover;" class="box-highlight-item" data-aos="fade-up" data-aos-duration="600">
        <h2><?php echo $highlightboxone['headline']; ?></h2>
        <label><?php echo $highlightboxone['sub_headline']; ?></label>
        <a>"><button><?php echo $highlightboxone['button_text']; ?></button></a>	
      </div>
    <?php endif; ?>
    <?php if( $highlightboxtwo ): ?>
      <div style="background: linear-gradient(0deg, rgba(102, 102, 102, 0.45), rgba(102, 102, 102, 0.45)), url(<?php echo esc_url( $highlightboxtwo['background_image']['url'] ); ?>) no-repeat center / cover;" class="box-highlight-item" data-aos="fade-up" data-aos-duration="600">
        <h2><?php echo $highlightboxtwo['headline']; ?></h2>
        <label><?php echo $highlightboxtwo['sub_headline']; ?></label>
        <a>"><button><?php echo $highlightboxtwo['button_text']; ?></button></a>	
      </div>
    <?php endif; ?>
    
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.