WordPress.org

Ready to get started?Download WordPress

Forums

PHP for alt tag (1 post)

  1. bitsyandkitty
    Member
    Posted 9 months 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

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 9 months ago by bitsyandkitty
  • This topic is not resolved
  • WordPress version: 3.7.1

Tags