Link Thumbnail to permalink not working
-
Hi!
I was trying to link my thumbail image for every post to the permalink of the post. I found this code and a lot of people seems like having success by adding it to the functions.php:
add_filter('excerpt_more', 'supernova_new_excerpt_more'); function supernova_new_excerpt_more($more) { global $post; return '<a class="moretag" href="'. get_permalink($post->ID) . '">'.__('... Read More', 'Supernova').'</a>';} add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 ); function my_post_image_html( $html, $post_id, $post_image_id ) { $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>'; return $html; }
Doesnt’t work for me ??
Please help
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Link Thumbnail to permalink not working’ is closed to new replies.