WordPress.org

Ready to get started?Download WordPress

Forums

PHP for alt tag (1 post)

  1. bitsyandkitty
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags