【问题标题】:Remove Lightbox on one page in wordpress在 wordpress 中删除一页上的灯箱
【发布时间】:2018-01-17 15:51:47
【问题描述】:

我有一个页面,如果您点击图片,它会在灯箱中打开,现在我希望它是这样,如果点击图片,它会转到单独的 URL。

现在您可以在 Wordpress 中使用“媒体链接”来执行此操作,但使用的主题已覆盖它无法正常工作。解决这个问题的最佳方法是什么?

例子:

单击此页面中的图像 - http://wp.themedemo.co/whizz/home-full-gallery/ 将打开灯箱而不是我希望它转到这样的画廊 - http://wp.themedemo.co/whizz/home-minimal-gallery/

谢谢!

【问题讨论】:

    标签: javascript php wordpress fancybox lightbox


    【解决方案1】:

    到目前为止我有这个 -

    function whizz_enqueue_scripts() {
        // if this is not the contact page, remove the script
        if( ! is_page(2638) ){
            wp_dequeue_script( 'fancybox' );
        }
    }
    // adjust priority to make sure this runs after the plugins add their scripts/styles
    add_action( 'wp_enqueue_scripts', 'whizz_enqueue_scripts', 100 );
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-26
      相关资源
      最近更新 更多