Support

Account

Home Forums General Issues Link thumbnail image to full sized image

Unread

Link thumbnail image to full sized image

  • Hi, I searched the forum first but the threads all dealt with complex cases.

    I am using the ‘object’ return value and want to wrap my thumbnail to link to the full sized image. Here is the code that manages to display the thumbnail, and links to the URL instead.

    $image = get_field('flips');
    					$size = 'thumbnail';
    					$thumb = $image['sizes'][ $size ];
    					$width = $image['sizes'][ $size . '150' ];
    					$height = $image['sizes'][ $size . '150' ];
    					 
    					if( !empty($image) ): ?>
    					 
    						
    					<a href="<?php echo $url; ?>" title="<?php echo $title; ?>">
    					 
    							
    					<img src="<?php echo $thumb; ?>" width="<?php echo $width; ?>" height="<?php echo $height; ?>" />
    					 
    					<?php endif; ?>
Viewing 1 post (of 1 total)

The topic ‘Link thumbnail image to full sized image’ is closed to new replies.