• A previous developer has created a slider for a site but the issue is that there are no alt tags on the images and I have been asked to add them.

    I’ve tried a few things with no success

    Here is the code..

    <?php if( $slider = get_page_images( get_the_id(), 'sc_banner_image', 'sc_banner_image' ) ) : ?>
    
      <div class="slider">
    
        <div class="slider-container">
    
          <div class="slider-inner">
    
            <?php foreach($slider as $slide) : ?>
    
              <img src="<?php echo $slide[0]; ?>" alt="<?php echo $alt_text; ?>"/>
    
            <?php endforeach; ?>
    
          </div>
    
        </div>
    
      </div>
    
    <?php endif; ?>

    Can anyone assist?

  • The topic ‘Echo Image Alt Tag’ is closed to new replies.