• Resolved berez

    (@berez)


    Usually to open a thumbnail in full, I use this code –

    <?php
     if ( has_post_thumbnail()) {
       $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
       echo '<a href="' . $large_image_url[0] . '" >';
       the_post_thumbnail('medium');
       echo '</a>';
     }
     ?>

    How can I do the same thing, but using your code?
    <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'three-image'); endif; ?>
    Really need to do this … Thank you!

    https://www.ads-software.com/extend/plugins/multiple-post-thumbnails/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Chris Scott

    (@chrisscott)

    Try:
    <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'three-image', get_the_ID(), 'full'); endif; ?>

    Chris, it’s doesn’t work for me :/

    <a target="_blank" href="#">
                <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'plan2D'); endif; ?>

    What the php code to link the img to the full size ?

    Best

    Ok i found my answer on an far away other post ^^
    remplace

    <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'My_post_type'); endif; ?>

    by

    <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail('myCustomPostType or post', 'My_post_type', NULL, 'post-thumbnail', NULL, true); endif; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can i add to your php code, link to full size image?’ is closed to new replies.