编程语言
首页 > 编程语言> > php – WordPress WPBakery禁用prettyPhoto并使用Responsive Lightbox&Gallery

php – WordPress WPBakery禁用prettyPhoto并使用Responsive Lightbox&Gallery

作者:互联网

我有这个wordpress网站及其使用WPBakery,我想要做的是禁用PrettyPhoto并使用Responsive Lightbox& amp;画廊.

我通过将以下代码添加到我的functions.php文件中来禁用PrettyPhoto:

function remove_vc_prettyphoto(){
  wp_dequeue_script( 'prettyphoto' );
  wp_deregister_script( 'prettyphoto' );
  wp_dequeue_style( 'prettyphoto' );
  wp_deregister_style( 'prettyphoto' );
}
add_action( 'wp_enqueue_scripts', 'remove_vc_prettyphoto', 9999 );

然后我安装了插件Responsive Lightbox&图库并​​将选择器更改为prettyPhoto,但它不起作用,当我单击图像时,它只是在同一窗口中打开图像.我做了一些挖掘,我认为原因可能是因为我的链接使用的是data-rel而不是rel,我的问题是,这是它无法工作的原因和/或我该如何修复它?

<a href="http://example.com/wp-content/uploads/2018/10/Making-Her-Mrs-Toronto-Wedding-Planners-5-731x1024.jpg" title="Romantic Blush-Toned Weddings" data-rel="prettyPhoto[rel--1933041382]" data-vc-gitem-zone="prettyphotoLink" class="vc_gitem-link prettyphoto vc-zone-link vc-prettyphoto-link"></a>

UPDATE

我可以将data-rel更改为rel或prettyPhoto [rel – 1933041382]到lightbox,但它不能在特定页面上工作:

http://makinghermrs.com/lookbook/

但是在这个只有一张照片的页面上它可以工作:

http://makinghermrs.com/3748-2/

UPDATE

好吧,我得到了它的工作,但灯箱在移动设备上运行不正常,桌面上有问题,我做错了什么?

http://makinghermrs.com/lookbook/

解决方法:

>转到响应式灯箱设置并启用“强制灯箱”选项.
>在“选择器”字段中输入“prettyPhoto”,如图所示

enter image description here

标签:wordpress,php,lightbox
来源: https://codeday.me/bug/20190710/1424337.html