首页 文章

启用右键单击Wordpress站点

提问于
浏览
1

我继承了另一个开发者构建的网站,我正在尝试对其进行更新 . 他设法禁止在不使用插件的情况下右键点击网站,我不知道他是怎么做到的 .

该网站是https://tracywrightcorvo.com/

这是使用Salient主题的WordPress .

我真的希望你们中的一位才华横溢的人能帮助我弄清楚如何重新启用网站上的右键点击 .

谢谢!!

2 回答

  • 3

    如果您尝试加载禁用javascript的网站,您将意识到右键单击有效 . 使用一小部分代码禁用右键单击非常常见,这些代码大部分都是无用的(你可以很容易地看到它们被禁用)并且它只会使大多数用户烦恼 .

    无论如何,如果你查看你的源代码,你会看到这个文件:

    wp-content/plugins/nextgen-gallery-pro/modules/image_protection/static/custom.js
    

    有了这个JavaScript:

    (function($) {
        $(document).bind('contextmenu dragstart', function(event) {
            var target = event.target || event.srcElement;
            target = $(target);
            if (target.data('ngg-protect')             // image is directly 'protected'
            ||  target.parent('a').data('ngg-protect') // parent anchor is 'protected'
            ||  target.attr('id') == 'fancybox-img'    // Fancybox
            ||  target.attr('id') == 'TB_Image'        // Thickbox
            ||  target.attr('id') == 'shTopImg'        // Shutter, Shutter 2
            ||  target.attr('id') == 'lightbox-image'  // 'Lightbox'
            ||  target.hasClass('highslide-image')    // Highslide
            ||  target.parents('.ngg-albumoverview').length == 1
            ||  target.parents('.ngg-pro-album').length == 1
            ||  photocrati_image_protection_global.enabled == '1')
            {
                event.preventDefault();
            }
        });
    }(jQuery));
    

    只需从functions.php中删除它,查找wp_enqueue_script() .

    #Edit 2:

    我还注意到以下几点:

    var photocrati_image_protection_global = {"enabled":"1"};
    

    关于“photocrati”的一些搜索,我建议你检查:

    Theme Options -> Gallery Settings -> Right-Click Protection
    

    我希望以上任何一项都能帮到你 .

  • 0

    检查表wp_photocrati_gallery_settings列fs_rightclick,是“开”还是“关”?

    如果“开”,则将其更改为“关” .

相关问题