Please note: This is an old post. The information is probably not accurate and up-to-date anymore.
Hvis du bruger WordPress’ 2.9 thumbnail feature, vil din thumbnail som standard ikke linke til dit indlæg. Hvis du vil have den til at gøre det, skal du tilføje dette til dit temas functions.php
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; }
Overstående kode er taget fra Justin Tadlocks indlæg “Everything you need to know about WordPress 2.9′s post image feature”, hvor du kan læse meget mere om hvordan du kommer til at bruge thumbnail funktionen.
Hvis du ikke ønsker at den skal linke til indlægget på selve indlægssiden, kan du tilføje if ( !is_single() )
if ( !is_single() ) $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_the_title( $post_id ) ) . '">' . $html . '</a>';