How this script works?
This script will read every word on every article, for example if we define the word "SEO" in the script, then automatically all pages that have the word "SEO" will become a link.
Apply to blogspot, follow this step :
1. Sign into Blogger dashboard » Edit HTML
2. Find this code </body>, copy and paste the following code above the code </body>
<b:if cond='data:blog.url != data:blog.homepageUrl'><script type='text/javascript'>
function autoLink(){
this.keywdHref = new Object();
this.add = function(keyword, href){
if(keyword.substr(0,1) != " "){keyword = " " + keyword;}
this.keywdHref[keyword] = href;
}
this.createAnchor = function(){
var objs = document.getElementsByTagName("div");
for(var i=0; i<objs.length; i++){
var obj = objs[i];
if(obj.className.indexOf("post-body")>-1){
var content = obj.innerHTML;
for(var keyword in this.keywdHref){
var href = this.keywdHref[keyword];
var newstr = content.replace(keyword, "<a href='"+href+"'>"+keyword+"</a>", "gi");
obj.innerHTML = newstr;
content = newstr;
}
}
}
}
this.startScript = function(){
var onLoad = window.onload;
window.onload = function(){
if(onLoad){onLoad();}
setTimeout("f.createAnchor()", 100);
}
}
}
</script>
<script type='text/javascript'>
var f = new autoLink();
f.add("seo", "your blog url");
f.startScript();
</script></b:if>
Notes :
* Replace the text SEO with the keywords you want.
* Change your blog url with the address of your blog.
* IMPORTANT!! KEYWORDS SUBMITTED ARE CASE SENSITIVE
3. Save, Smart link SEO plugin is now installed on your blog
Post a Comment
Note: Only a member of this blog may post a comment.