• 07-11-2014, 20:54:40
    #1
    Merhaba arkadaşlar,

    wordpress'de kullandığım sitede bazı içerikleri rss poster eklentisi ile haber sitelerinden çekiyorum çekilen içeriklerde mutlak resim oluyor fakat tema'da görseller öne çıkarılmadığı zaman slider'da ve konu listeleme alanında hatalar oluşuyor temada nasıl ayarlayabilirim yardımcı olabilicek varmı
  • 07-11-2014, 21:19:00
    #2
    Bazı resimlerinizi özel alan ile bazıları öne çıkarılan görsel olarak ekliyorsanız veya resim yoksa başka bir görsel gösterebilirsiniz aşağıdaki kodları kullanın:

      <?php if ( has_post_thumbnail() ) {  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false, '' ); $thumbnailSrc = $src[0]; ?>	
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo  $thumbnailSrc; ?>" width="300" height="150" alt="<?php the_title(); ?>" /></a>
    <?php } else { ?>
    
    <?php $resim = get_post_meta($post->ID,'resim', true);
     
    if($resim != "") {  ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<? echo ($resim); ?>" width="300" height="150" alt="<?php the_title(); ?>" /></a>
    
    <?php }else{ ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="http://demo.habermatik.net/v3/wp-content/themes/HaberMatikV3/images/habermatik.jpg" width="300" height="150" alt="<?php the_title(); ?>" /> </a>
     
                <?php } ?>
                <?php }?>
  • 07-11-2014, 21:44:11
    #3
    akinciyiz adlı üyeden alıntı: mesajı görüntüle
    Bazı resimlerinizi özel alan ile bazıları öne çıkarılan görsel olarak ekliyorsanız veya resim yoksa başka bir görsel gösterebilirsiniz aşağıdaki kodları kullanın:

      <?php if ( has_post_thumbnail() ) {  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false, '' ); $thumbnailSrc = $src[0]; ?>	
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<?php echo  $thumbnailSrc; ?>" width="300" height="150" alt="<?php the_title(); ?>" /></a>
    <?php } else { ?>
    
    <?php $resim = get_post_meta($post->ID,'resim', true);
     
    if($resim != "") {  ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<? echo ($resim); ?>" width="300" height="150" alt="<?php the_title(); ?>" /></a>
    
    <?php }else{ ?>
     
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="http://demo.habermatik.net/v3/wp-content/themes/HaberMatikV3/images/habermatik.jpg" width="300" height="150" alt="<?php the_title(); ?>" /> </a>
     
                <?php } ?>
                <?php }?>
    öncelikle yardımın için teşekkürler, fakat konu içinde resim olduğu halde hep habermatik resmini çekti yanlış uygulamış olabilirmiyim

    temanın anasayfa'daki slide kodu
                
    <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-thumbnails', false, '' ); $thumbnailSrc = $src[0]; ?>	
    	        <?php $image = aq_resize( $thumbnailSrc, 1240, 500, true ); ?>
    	     	<img alt="<?php the_title(); ?>" src="<?php echo $image ?>" />
    Sizin verdiğiniz kodu şu şekilde kullandım
    <?php if ( has_post_thumbnail() ) {  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'medium', false, '' ); $thumbnailSrc = $src[0]; ?>     
    			<?php $image = aq_resize( $thumbnailSrc, 1240, 500, true ); ?>
    			<img alt="<?php the_title(); ?>" src="<?php echo  $thumbnailSrc; ?>"  /> 
    <?php } else { ?> 
    
    			<?php $resim = get_post_meta($post->ID,'resim', true); 
    			if($resim != "") {  ?> 
    			<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<? echo ($resim); ?>"  alt="<?php the_title(); ?>" /></a> 
    
    <?php }else{ ?> 
      
    			<img src="http://demo.habermatik.net/v3/wp-content/themes/HaberMatikV3/images/habermatik.jpg" alt="<?php the_title(); ?>" /> </a> 
      
                <?php } ?> 
                <?php }?>
  • 07-11-2014, 21:47:32
    #4
    şu bölümdeki: get_post_thumbnail_id($post->ID), 'medium', false, "medium" kelimesini silip bunu yazın: post-thumbnails
  • 07-11-2014, 22:28:56
    #5
    akinciyiz adlı üyeden alıntı: mesajı görüntüle
    şu bölümdeki: get_post_thumbnail_id($post->ID), 'medium', false, "medium" kelimesini silip bunu yazın: post-thumbnails
    			<?php if ( has_post_thumbnail() ) {  $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'post-thumbnails', false, '' ); $thumbnailSrc = $src[0]; ?>     
             <?php $image = aq_resize( $thumbnailSrc, 1240, 500, true ); ?>
             <img alt="<?php the_title(); ?>" src="<?php echo  $thumbnailSrc; ?>"  /> 
    <?php } else { ?> 
     
             <?php $resim = get_post_meta($post->ID,'resim', true); 
             if($resim != "") {  ?> 
             <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><img src="<? echo ($resim); ?>"  alt="<?php the_title(); ?>" /></a> 
     
    <?php }else{ ?> 
       
             <img src="http://demo.habermatik.net/v3/wp-content/themes/HaberMatikV3/images/habermatik.jpg" alt="<?php the_title(); ?>" /> </a> 
       
                <?php } ?> 
                <?php }?>
    kodun olduğu şekli çalışmadı ne yazık kı sayfada ki çıktısı

    <img alt="Erdoğan’a fahri profesörlük unvanı verildi" src="">
  • 07-11-2014, 23:02:03
    #6
    $resim değişkenini ben örnek olarak yazmıştım sizin kodlarınızda $image olarak girilmiş bunları da düzenlerseniz çalışır.
  • 08-11-2014, 00:42:24
    #7
    akinciyiz arkadaşa yardımlarından dolayı teşekkür ederim fakat henüz düzenlemeyi yapamadık varmı başka yardımcı olabilcek