Home Forums Plugin Support WP User Frontend (Free Version) only one thumbnail

This topic is: resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Tareq Hasan 5 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #13095

    christophe
    Member
    Post count: 18

    hello just a php question if i want only one thumbail the first one picture
    how can i do that ?
    thanks

    $images = get_post_meta( $post->ID, ‘photo_du_projet' );

    if ( $images ) {
    foreach ( $images as $attachment_id ) {
    $thumb = wp_get_attachment_image( $attachment_id, ‘thumbnail' );
    $full_size = wp_get_attachment_url( $attachment_id );

    printf( ‘%s‘, $full_size, $thumb );
    }
    }

    ?>

    #13202

    Tareq Hasan
    Keymaster
    Post count: 2831

    Use like this:
    [php]
    $images = get_post_meta( $post->ID, ‘photo_du_projet', true );

    if ( $images ) {
    $thumb = wp_get_attachment_image( $images, ‘thumbnail' );
    $full_size = wp_get_attachment_url( $images );

    printf( ‘%s', $full_size, $thumb );
    }
    [/php]

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘only one thumbnail’ is closed to new replies.