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
Hi,
You can use this plugin:
http://wordpress.org/plugins/no-right-click-images-plugin/
It works a treat. :)
Regards,
Ismael
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.
Regards,
Devin
Well the site is live you can see it from this address http://bilgin-group.com/
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?