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


    I have added the code below to header.php

    <script type=”text/javascript”>

    function nocontext(e) {

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

    if (clickedTag == “IMG”) {


    return false;



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

    document.oncontextmenu = nocontext;


    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




    You can use this plugin:

    It works a treat. :)




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


    Hi murattemel,

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




    Well the site is live you can see it from this address


    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.


    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?



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



Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Disable right click on all images’ is closed to new replies.