I've tried many things and many solutions but i can't make product images clickable. Here's the code:
if ( has_post_thumbnail() ) {
$images .= get_the_post_thumbnail( $post->ID, 'shop_catalog' );
}
If i make the code look like this, it doesn't show images:
return '<a href="' . get_permalink( $post->ID ) . '">' . get_the_post_thumbnail( $post->ID, 'shop_catalog' ) . '</a>';
I've tried many things and many solutions but i can't make product images clickable. Here's the code:
if ( has_post_thumbnail() ) {
$images .= get_the_post_thumbnail( $post->ID, 'shop_catalog' );
}
If i make the code look like this, it doesn't show images:
return '<a href="' . get_permalink( $post->ID ) . '">' . get_the_post_thumbnail( $post->ID, 'shop_catalog' ) . '</a>';
Share
Improve this question
asked Mar 5, 2016 at 18:54
Lukas BaranauskasLukas Baranauskas
235 bronze badges
1 Answer
Reset to default 0try this..
$images .= '<a href="' . get_permalink( $post->ID ) . '">';
if ( has_post_thumbnail() ) {
$images .= get_the_post_thumbnail( $post->ID, 'shop_catalog' );
}
$images .= '</a>';