WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] featured image url (5 posts)

  1. mahabub78
    Member
    Posted 2 years ago #

    please help me. how to get only featured image url. just like <img src="---featured image url---"/>.
    please some body help me.
    thanks.

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

  3. mahabub78
    Member
    Posted 2 years ago #

    @alchymyt thanks ans. but this code dose not work. i want only image src link.

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    try:

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'thumbnail' );
    $url = $thumb['0'];

    http://codex.wordpress.org/Post_Thumbnails

    if this should not work, please give more details.

  5. mahabub78
    Member
    Posted 2 years ago #

    thanks for help. but i get a new code `<?php
    if(has_post_thumbnail()) {
    ?>
    <div class="featured-image-container"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('medium'); ?></a></div><?php
    }
    ?>`
    thanks again

Topic Closed

This topic has been closed to new replies.

About this Topic