Title: PHP for alt tag
Last modified: August 21, 2016

---

# PHP for alt tag

 *  [bitsyandkitty](https://wordpress.org/support/users/bitsyandkitty/)
 * (@bitsyandkitty)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/php-for-alt-tag/)
 * Hi,
 * I have a template with this code;
 *     ```
       <?php while(have_posts()): the_post(); ?>
       		  <a href="<?php colabs_image('link=url'); ?>" rel="lightbox"><?php colabs_image('width=157&height=157&link=img'); ?></a>
       		  <?php echo '<div class="time">
       						<p class="entry-time">
       							<i class="icon-time"></i>
       							<span>'.get_the_date().'</span>
       						</p>
       					  </div>'; ?>
       		  <?php endwhile; ?>
       ```
   
 * I’d like to change the image’s date published being shown to the image’s alt 
   tag via the small piece of code – <span>’.get_the_date().'</span>
 * i’ve tried all sorts inc; $alt_text = get_post_meta($img_id , ‘_wp_attachment_image_alt’,
   true); etc etc
    NO LUCK! can anyone help? many thanks in advance

The topic ‘PHP for alt tag’ is closed to new replies.

## Tags

 * [alt](https://wordpress.org/support/topic-tag/alt/)
 * [img](https://wordpress.org/support/topic-tag/img/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [tag](https://wordpress.org/support/topic-tag/tag/)

 * 0 replies
 * 1 participant
 * Last reply from: [bitsyandkitty](https://wordpress.org/support/users/bitsyandkitty/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/php-for-alt-tag/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
