$resimler = [
'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/ihlas.png',
'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/asel.png',
'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/anadolu.png',
];
shuffle($resimler);
foreach ($resimler as $resim){
echo '<img src="'.$resim.'"width="650" height="160">';
} wordpress php kodu düzenkemek
9
●236
- 18-04-2019, 19:26:25arkadaşlar aşağıda vereceğim kodda her resme ayrı link eklemek istiyorum yardım edebilecek var mı ?
- 18-04-2019, 19:41:44
<?php $resimler = [ 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/ihlas.png', 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/asel.png', 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/anadolu.png', ]; shuffle($resimler); foreach ($resimler as $resim){ if(strpos($resim, "ihlas")) { $link ="ihlas.com"; } else if(strpos($resim, "asel")) { $link ="asel.com"; } else if(strpos($resim, "anadolu")) { $link ="anadolu.com"; } else { $link = "#"; } echo '<a href="'.$link.'"> <img src="'.$resim.'"width="650" height="160"> </a>'; } ?> - 18-04-2019, 19:45:00buradaki linkler örneğin: tel:1234567898 şeklinde kullanılabilir mi ?mustaizm adlı üyeden alıntı: mesajı görüntüle
- 18-04-2019, 19:47:55Evet kullanabilirsiniz,malih adlı üyeden alıntı: mesajı görüntüle
$link ="ihlas.com";
yerine
$link ="tel:1234567898";
kullababilirsiniz - 18-04-2019, 19:50:29Aynen hocam öyle yaptım ama asel ile anadolu linklarini faklı yazıyorum aynı gözüküyor ?mustaizm adlı üyeden alıntı: mesajı görüntüle
- 18-04-2019, 19:54:51
<?php $resimler = [ 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/ihlas.png', 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/asel.png', 'https://www.aselnakliyat.gen.tr/wp-content/uploads/2019/04/anadolu.png', ]; shuffle($resimler); foreach ($resimler as $resim){ if(strpos($resim, "ihlas.png")) { $link ="ihlas.com"; } else if(strpos($resim, "asel.png")) { $link ="asel.com"; } else if(strpos($resim, "anadolu.png")) { $link ="anadolu.com"; } else { $link = "#"; } echo '<a href="'.$link.'"> <img src="'.$resim.'"width="650" height="160"> </a>'; } ?> - 18-04-2019, 19:57:07Çok teşekkürler hocam oldu resim ekledikçe altın link ekleyerek devam edebiliriz ?mustaizm adlı üyeden alıntı: mesajı görüntüle
- 18-04-2019, 19:59:42Evet else ifleri kopyala yapıştır değiştir.malih adlı üyeden alıntı: mesajı görüntüle
else if(strpos($resim, "YeniResim.png")) { $link ="yenilink.com"; }