添加链接到一个php图像
我的WordPress主题有一个带有全屏滚动图像的演示页面模板。我想为每个图像添加一个单独的链接。我该怎么做添加链接到一个php图像,php,css,wordpress,image,hyperlink,Php,Css,Wordpress,Image,Hyperlink,我的WordPress主题有一个带有全屏滚动图像的演示页面模板。我想为每个图像添加一个单独的链接。我该怎么做 <?php } else if ($presentation_type == 'image'){ ?> <div class="section" data-id="<?php echo $presentation_name; ?>" style="background-image: url(&l
<?php } else if ($presentation_type == 'image'){ ?>
<div class="section" data-id="<?php echo $presentation_name; ?>" style="background-image: url(<?php echo $presentation_image; ?>);" data-nav-color="<?php echo $presentation_style; ?>">
如果您在
HTML5中没有动态代码,则允许您简单地使用和
您还可以使用data-attribute并使用data-URL和JavaScript将URL添加到当前div中以打开链接,如下所示:
<div class="section" data-id="<?php echo $presentation_name; ?>" style="background-image: url(<?php echo $presentation_image; ?>);" data-nav-color="<?php echo $presentation_style; ?>" data-url="<?php echo $url; ?>">
您希望链接在哪里?包装滚动图像?
<div class="section" data-id="<?php echo $presentation_name; ?>" style="background-image: url(<?php echo $presentation_image; ?>);" data-nav-color="<?php echo $presentation_style; ?>" data-url="<?php echo $url; ?>">