Mục Lục
Code to automatically insert the original article link when copying for WordPress and Blogspot websites
Currently, many websites and blogs themselves write very good and meaningful articles, but encounter the trouble of being copied all over. Many websites develop massively without caring about the content, do not write their own articles, but just copy other people’s articles. Moreover, when copying, the source of the article is not mentioned – not respecting the author.
Code to automatically insert the original article link when copying for WordPress and Blogspot websitesWe can not fight those who specialize in copying because the good articles we share, they will find all ways to copy them. So the only way is to let them copy. But if they copy without the source, we have to manually insert the code to insert the original link of the article so that when they copy it, it will automatically insert the source link at the end of the article. The method will be useful if someone copy and forget to review or are too lazy to just copy and paste and post the article, they can include the article source link. Otherwise, it will also prompt conscious copyists to credit the source. To do that, you just need to insert 1 more code and you’re done.
Code to automatically insert the original article link when copying for WordPress and Blogspot websites
Đây là code tự chèn link gốc bài viết khi copy cho website WordPress:
<!--Start Ghi nguon bai viet-->
<script type="text/javascript">
function addLink() {
var body_element = document.getElementsByTagName('body')[0];
var selection;
selection = window.getSelection();
var pagelink = "<br /><br /> Nguồn bài viết: <a href='"+document.location.href+"'>"+document.location.href+"</a><br />"; // change this if you want
var copytext = selection + pagelink;
var newdiv = document.createElement('div');
body_element.appendChild(newdiv);
newdiv.innerHTML = copytext;
selection.selectAllChildren(newdiv);
window.setTimeout(function() {
body_element.removeChild(newdiv);
},0);
}
document.oncopy = addLink;
</script>
<!--End Ghi nguon bai viet-->
Code to automatically insert the original article link when copying for WordPress and Blogspot websites
Hướng dẫn bằng video trên https:// b-mart.vn
Xem tại đây
https: //youtu.be/Niy2LGJ8gm0
Warning: Trying to access array offset on false in /home/renthous/allnet.vn/wp-content/themes/flatsome/inc/shortcodes/share_follow.php on line 29