DRE
Well-known member
When creating a post, the featured image on the index or category page links to the picture and not the blog. Most wordpress themes link directly to the article. Am I the only person having this problem with XenDynamic?
I googled and answer and found that this code added to my functions.php file will link the picture directly to the blog. The problem is that the image loses it's position. How do I 'not' move it but retain this 'links thumbnail to post permalink' edit?
In wp-content/themes/XenDynamic/functions.php
I googled and answer and found that this code added to my functions.php file will link the picture directly to the blog. The problem is that the image loses it's position. How do I 'not' move it but retain this 'links thumbnail to post permalink' edit?
In wp-content/themes/XenDynamic/functions.php
Code:
// THIS LINKS THE THUMBNAIL TO THE POST PERMALINK
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_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
return $html;
}