• 21-11-2013, 14:04:22
    #10
    seemsiyah adlı üyeden alıntı: mesajı görüntüle
    hocam the_content kodunuz aynı şekilde kalsın, temanızdaki functions.php içerisine şu kodları ekleyin:
    function anasayfada_sadece_ilk_resim( $icerik ) {
    	if( is_home() || is_category() || is_front_page() ){
    		$output = @preg_match_all('/<a(.*?)><img.+src=[\'"]([^\'"]+)[\'"].*><\/a>/i', $icerik, $matches);
    		if( empty( $matches[0][0] ) ){
    			return $icerik;
    		} else {
    			return $matches[0][0];
    		}
    	} else {
    		return $icerik;
    	}
    }
    add_filter( 'the_content', 'anasayfada_sadece_ilk_resim' );
    Hocam kullandığım temada functions.php yok .s
    Edit: Hocam ekledim son durum şu;
    http://m1080p.net/
  • 21-11-2013, 14:27:53
    #11
    Kimlik doğrulama veya yönetimden onay bekliyor.
    Madebodom adlı üyeden alıntı: mesajı görüntüle
    Hocam kullandığım temada functions.php yok .s
    yoksa yeni bir functions.php olusturup kodlari icerisine at calisacaktir.
  • 21-11-2013, 14:35:23
    #12
    Ergün adlı üyeden alıntı: mesajı görüntüle
    yoksa yeni bir functions.php olusturup kodlari icerisine at calisacaktir.
    Tamamdır hocam ekledim fakat sorun devam ediyor..
  • 21-11-2013, 15:21:38
    #13
    functions.php icerisine bunlarida ekle

    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 eklememişseniz
     $resimbir = "/images/default.jpg";
     }
     return $resimbir;
    }
    Daha sonra temandaki
    <?php the_content(' '); ?>
    asagidaki ile degistir

    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo resimgoster() ?>" /></a>
  • 21-11-2013, 15:24:58
    #14
    Ergün adlı üyeden alıntı: mesajı görüntüle
    functions.php icerisine bunlarida ekle

    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 eklememişseniz
     $resimbir = "/images/default.jpg";
     }
     return $resimbir;
    }
    Daha sonra temandaki
    <?php the_content(' '); ?>
    asagidaki ile degistir

    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo resimgoster() ?>" /></a>
    Olmadı hocam, resimler falan gitti iyice sayfanın yarısı var yarısı yok;
    http://m1080p.net/
  • 21-11-2013, 15:45:39
    #15
    Madebodom adlı üyeden alıntı: mesajı görüntüle
    Olmadı hocam, resimler falan gitti iyice sayfanın yarısı var yarısı yok;
    http://m1080p.net/
    kodu yanlis yere eklemissin temandaki functions.php icerisine ekleyeceksin <?php ?> icerisine
  • 21-11-2013, 15:50:19
    #16
    Ergün adlı üyeden alıntı: mesajı görüntüle
    kodu yanlis yere eklemissin temandaki functions.php icerisine ekleyeceksin <?php ?> icerisine
    Hocam temada functions.php yoktu bende bir metin belgesi açtım içine kodu ekledim farklı kaydet diyerek functions.php yaptım dosyanın adını yükledim. Acaba şöyle mi yapmak lazım;
    <?php
    verdiğiniz kod
    ?>
  • 21-11-2013, 15:55:07
    #17
    evet aynen php taglari icerisine ekleyeceksin
    functions.php
     
    <?php
    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 eklememişseniz 
     
     $resimbir = "/images/default.jpg"; 
     
     } 
     return $resimbir; 
     
    }  
    ?>
  • 21-11-2013, 15:57:51
    #18
    Ergün adlı üyeden alıntı: mesajı görüntüle
    evet aynen php taglari icerisine ekleyeceksin
    functions.php
     
    <?php
    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 eklememişseniz 
     
     $resimbir = "/images/default.jpg"; 
     
     } 
     return $resimbir; 
     
    }  
    ?>
    Hocam r10+'ını gönderiyorum oldu teşekkürler ederim fakat sağ'da oldu, onu ortalarsak mükemmel olacak tek bir sorun kalacak