Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26581

    Hello,

    I have added the code below to header.php

    <script type=”text/javascript”>

    function nocontext(e) {

    var clickedTag = (e==null) ? event.srcElement.tagName : e.target.tagName;

    if (clickedTag == “IMG”) {

    alert(alertMsg);

    return false;

    }

    }

    var alertMsg = “Bilgin Group © 2013 Her Hakkı Saklıdır.”;

    document.oncontextmenu = nocontext;

    </script>

    It worked fine on the homepage but did not effect other pages of the theme. How can I add this code to the other pages. I have looked single.php, single-portfolio.php but could not see </head> line. Can you help me with that please

    Thanks

    #130933

    Hi,

    You can use this plugin:

    http://wordpress.org/plugins/no-right-click-images-plugin/

    It works a treat. :)

    Regards,

    Ismael

    #130934

    I did use that plug-in but it only effects home page not to other pages

    #130935

    Hi murattemel,

    We would need to see the site live to inspect the code and see whats going on.

    Regards,

    Devin

    #130936

    Well the site is live you can see it from this address http://bilgin-group.com/

    #130937

    That is very strange. Have you don’t any changes to the theme files? Made alternate header files or anything like that?

    The way the plugin works is that it just hooks into the wp_head which gets output on every page. I can see the other code that is getting output there but for some reason that specific script isn’t.

    You could try including it in your footer.php file as an alternative as well as disabling all other active plugins and then deactivating the plugin and reactivating it.

    #130938

    No I did not make any changes to the theme files or alternate header files. I will try those but I am not sure it will work fine. Is there any other thing that you can recommend to me?

    #130939

    Hi,

    I activated the plugin and it does work not only for the homepage but throughout the site.

    Regards,

    Ismael

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Disable right click on all images’ is closed to new replies.