Üstadlarım, anasayfada bulunan resimlere tıklanıldığında ilgili yazıya gitmesini istiyorum. Yazdığım kod:
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(custom-size, array('class' => 'img-responsive')); } else { echo '<img src="http://placehold.it/200x150" class="img-responsive" alt="">'; }?>
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>"/>
</a>
Nerede yanlış yapıyorum. Yardımlarınızı rica ediyorum.
Resimlere nasıl link verebilirim?
6
●223
- 11-01-2017, 23:40:19nerete ekliycem? sonuna mı?Erebus adlı üyeden alıntı: mesajı görüntüle
- 11-01-2017, 23:44:18
- 11-01-2017, 23:46:56<?php if ( has_post_thumbnail() ) { the_post_thumbnail(custom-size, array('class' => 'img-responsive')); } else { echo '<img src="http://placehold.it/200x150" class="img-responsive" alt="">'; }?>
<a href="<?php the_permalink(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>"/>
</a>
?>
bu şekilde mi olacak? - 11-01-2017, 23:57:42olmadı hocam.
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 23:55:38 -->-> Daha önceki mesaj 23:48:43 --
Kullanım örneği verebilir misiniz?
--R10.NET; Flood Engellendi -->-> Yeni yazılan mesaj 23:57:42 -->-> Daha önceki mesaj 23:55:38 --
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<img src="<?php the_post_thumbnail_url(); ?>"/>
</a>
<?php endif; ?>
Bu kodu kullanınca resimler kayboluyor.
Sonundaki php endifi kaldırınca resimler geliyor.