demreli adlı üyeden alıntı:
mesajı görüntüle
Bu eklentiyi ben kullanıyorum.Oldukça güzel bir eklenti.
15
●5.300
function show_thumb() {
global $post;
preg_match_all('/\< *[img][^\>]*src *= *[\"\']{0,1}([^\"\'\ >]*)/',get_the_content(),$matches);
$thumb = get_post_meta($post->ID, 'thumb', true);
if ($thumb) {
print '<a href="'.get_permalink($post).'"><img src="'.get_bloginfo('template_directory').'/timthumb.php?src='.$thumb.'&w=100&h=80&zc=1&cropfrom=middle&q=100" alt="'.str_replace('&', '&', $post->post_title).'" title="'.str_replace('&', '&', $post->post_title).'" /></a>';
} elseif (count($matches[1]) > 0) {
print '<a href="'.get_permalink($post).'"><img src="'.get_bloginfo('template_directory').'/timthumb.php?src='.$matches[1][0].'&w=100&h=80&zc=1&cropfrom=middle&q=100" alt="'.str_replace('&', '&', $post->post_title).'" title="'.str_replace('&', '&', $post->post_title).'" /></a>';
} else {
// nothing to do
}
}Şimdi temanın index.php yada archive.php yada category.php thumbnaillerin nerede görünmesini istiyorsanız o dosyayı açıp şu kodu ekliyoruz:<?php show_thumb(); ?>Bunun için temanın ana dizinine timthumb.php dosyasını koyuyoruz ve cache isimli klasör oluşturup izinini 755 ya da 777 yapıyoruz.