• 23-05-2010, 23:40:28
    #10
    TeknoGame adlı üyeden alıntı: mesajı görüntüle
    hocam nasıl yapabiliriz anlatsan olmaz mı?
    Sayfadaki ilk resmi çekmek için functions.php'nin sonuna;
    //thumbnail resim gosterme
    function resimgoster() {
    global $post, $posts;
    $resimbir = '';
    ob_start();
    ob_end_clean();
    $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
    $resimbir = $matches [1] [0];
    if(empty($resimbir)){ //Eğer resim yoksa
    $resimbir = "http://www.domain.com/empty.png";
    }
    return $resimbir;
    }
    Ayrıca home.php'deki
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" width="70" height="70"/></a>
    				<?php else: ?>
    				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    				<?php endif; ?>
    kodunu silip aşağıdakiyle değiştirmen gerek;
    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php echo resimgoster() ?>" alt="<?php the_title(); ?>" width="90" height="90"/></a>
  • 23-05-2010, 23:46:35
    #11
    Üyeliği durduruldu
    g6kh6n adlı üyeden alıntı: mesajı görüntüle
    Sayfadaki ilk resmi çekmek için functions.php'nin sonuna;
    //thumbnail resim gosterme
    function resimgoster() {
    global $post, $posts;
    $resimbir = '';
    ob_start();
    ob_end_clean();
    $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
    $resimbir = $matches [1] [0];
    if(empty($resimbir)){ //Eğer resim yoksa
    $resimbir = "http://www.domain.com/empty.png";
    }
    return $resimbir;
    }
    Ayrıca home.php'deki
    <?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
    				    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" width="70" height="70"/></a>
    				<?php else: ?>
    				   	<a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php bloginfo('template_url'); ?>/images/thumbnail.png" alt="<?php the_title(); ?>" /></a>
    				<?php endif; ?>
    kodunu silip aşağıdakiyle değiştirmen gerek;
    <a href="<?php the_permalink() ?>" rel="bookmark"><img style="float:left;margin:0px 10px 0px 0px;"  src="<?php echo resimgoster() ?>" alt="<?php the_title(); ?>" width="90" height="90"/></a>


    tamamdır hocam çok teşekkür ediyorum elinize sağlık

    şimdi sadece botla çektiğim dizinlerin resimleri çıkmıyor:S bunun için bottamı oynama yapmak lazım acaba? bu botu kullanıyorum
  • 30-06-2010, 00:06:31
    #12
    Üyeliği durduruldu
    Arkadaşlar merhaba konuyu tekrar açıyorum maalesef.
    yeni tema kullanmaya başladım burada söylenenleri aynen uyguladım yanlız sürekli hata alıyorum.

    //thumbnail resim gosterme function resimgoster() { global $post, $posts; $resimbir = ''; ob_start(); ob_end_clean(); $output = preg_match_all('//i', $post->post_content, $matches); $resimbir = $matches [1] [0]; if(empty($resimbir)){ //E�er resim yoksa $resimbir = "http://www.domain.com/empty.png"; } return $resimbir;
    alınan hata bu