headermask image

header image

自动给wordpress博客加版权信息

月光博客上面发布了一小段给
wordpress blog自动加版权信息的代码,这样别人在拷贝的时候自动会加上定义好的文字,很是不错,下面的就是自动加的。

<script type=”text/javascript”>
document.body.oncopy=function(){
 event.returnValue=false;
 var t=document.selection.createRange().text;
 var s=”本文来源于<?php bloginfo(’name’); ?> <?php echo get_settings(’home’); ?> , 原文地址: <?php the_permalink() ?> “;
 clipboardData.setData(’Text’,'\r\n’+t+’\r\n’+s+’\r\n’);
}
</script>

本文来源于月光博客 http://www.williamlong.info , 原文地址:http://www.williamlong.info/archives/1184.html

If you liked my post, feel free to subscribe to my rss feeds

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*