0
我在我的主頁上有滑塊橫幅,不會鏈接到任何位置。我需要爲每個圖像添加鏈接的代碼是什麼?是否可以用以下代碼?:將鏈接添加到滑塊橫幅
Thank you! I need to add a different link to each banner. The banners are all going to the printf('<a href="yourlink.html"> link. What am I doing wrong? <div id="home">
<div class="banner">
<div class="banner-slider">
<?php
if (!empty($options['slider_photo'])):
$slider_photos = explode(',', $options['slider_photo']);
foreach ($slider_photos as $k => $img):
printf('<a href="http://www.nemotile.com/tile/product/Handwritten/"><div class="banner-%d" style="background-image:url(%s)"></div></a>', $k, $img);
endforeach;
else: ?>
<a href="http://www.nemotile.com/tile/product/Handwritten/"><div class="banner-1"></div></a>
<a href="http://www.nemotile.com/tile/product/patchwork/"><div class="banner-2"></div>
<a href="http://www.nemotile.com/tile/product/BisazzaCementTiles/"><div class="banner-3"></div>
<div class="banner-5"></div>
<?php endif; ?>
</div>
謝謝!我需要爲每個橫幅添加不同的鏈接 –
@SophieMitchell我已經爲您編輯了我的答案。 –
工作。謝謝! –