• 30-08-2010, 14:11:49
    #1
    arkadşalar özel alana thumbnail yazınca resim çekiyor ama bu zahmetli olmaya başladı. Direk konu içindeki resmi küçük resim olacak nasıl ayarlıyabilirim ?
  • 30-08-2010, 14:22:32
    #2
    Öncelikle thimthump scripti tema klasöründe yüklü olmalı. Şuradan çekebilirsin.
    Sonrasında temanın function.php dosyasını aç

    <?php
    // retreives image from the post
    function getImage($num) {
    global $more;
    $more = 1;
    $content = get_the_content();
    $count = substr_count($content, '<img');
    $start = 0;
    for($i=1;$i<=$count;$i++) {
    $imgBeg = strpos($content, '<img', $start);
    $post = substr($content, $imgBeg);
    $imgEnd = strpos($post, '>');
    $postOutput = substr($post, 0, $imgEnd+1);
    $image[$i] = $postOutput;
    $start=$imgEnd+1;  
     
    $cleanF = strpos($image[$num],'src="')+5;
    $cleanB = strpos($image[$num],'"',$cleanF)-$cleanF;
    $imgThumb = substr($image[$num],$cleanF,$cleanB);
     
    }
    if(stristr($image[$num],'<img')) { echo $imgThumb; }
    $more = 0;
    }
    //retreive image ends
    ?>
    bunu ekle.

    sonra index.php ni aç
    <div class="thumbnail">
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
    <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php getImage('1'); ?>&w=150&h=150&zc=1">
    </a>
    </div>
    content den önce ekleyebilirsin. 150x150 bir resim oluşturcak bu.

    Sonra stil dosyanı aç
    .thumbnail a:link, .thumbnail a:visited {display:block; float:left; padding:5px; background:#e2e2e2; width:150px; height:150px; margin:5px 5px 0 0;}
    .thumbnail a:hover, .thumbnail a:active {background:#C4C4C4;}
    bunu ekle. işte bu kadar
  • 30-08-2010, 14:51:14
    #3
    sağolasın eline emeğine sağlık