WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Edit Title of Featured Image (2 posts)

  1. the.green.timtam
    Member
    Posted 2 years ago #

    I need to change the title attribute of my featured images displayed in a loop to

    "#image-<?php the_ID(); ?>"

    in order to get a jQuery banner to display the correct text. Is this possible?

  2. the.green.timtam
    Member
    Posted 2 years ago #

    DONE! This is the code that I used:

    <?php if (has_post_thumbnail( $post->ID ) ): ?>
    <?php $image = wp_get_attachment_image_src ( get_post_thumbnail_id ( $post_id ), 'single-post-thumbnail' ); ?>
    <img src="<?php echo $image[0]; ?>" title="#image-<?php the_ID(); ?>" height="500" width="1200"/></a>
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.