【发布时间】:2015-10-27 07:56:02
【问题描述】:
我想为我的图片库添加一个简单的灯箱插件。图像正在像这样的名为 gallery-template 的模板中获取
<?php
$args=array('post_type' => 'gallery');
$query= new WP_Query($args);
while ($query-> have_posts() ) : $query->the_post()?>
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-12">
<h1 class="product_txt"><?php the_title();?></h1>
<a href=''><?php the_post_thumbnail( 'full', array( 'class' => 'product_img') );?></a>
</div>
<?php
endwhile;
?>
我见过很多插件,但他们要求将图像添加到页面而不是从模板中获取它们,那么我怎样才能让它像这样工作呢?
【问题讨论】:
-
有什么问题?你想让它做什么不做什么?
-
只需将灯箱 jquery 加入队列,将
data-lightbox添加到您的图像中,就可以了。
标签: javascript php jquery wordpress