Saturday, August 21, 2010

How to make related article for blog

Related articles in a blog is very useful when visitors to see the contents of the blogs that you have, with the content matches the title of the blog interesting for the visitors happy to visit and could increase the pageview.

How to create Related Article on your blog :
* login to Blogger
* click design
add related article* click edit html
edit html* check Expand Widget Templates
check Expand Widget Templates* find code <data:post.body/>
* copy this code and put it under <data:post.body/>
example :
<data:post.body/>
<b:if cond='data:blog.pageType == "item"'>
<div class='similiar'>

<div class='widget-content'>
<h3>Related Article</h3>
<div id='data2007'/><br/><br/>
<script type='text/javascript'>

var homeUrl3 = &quot;<data:blog.homepageUrl/>&quot;;
var maxNumberOfPostsPerLabel = 4;
var maxNumberOfLabels = 10;

maxNumberOfPostsPerLabel = 100;
maxNumberOfLabels = 3;


function listEntries10(json) {
var ul = document.createElement(&#39;ul&#39;);
var maxPosts = (json.feed.entry.length &lt;= maxNumberOfPostsPerLabel) ?
json.feed.entry.length : maxNumberOfPostsPerLabel;
for (var i = 0; i &lt; maxPosts; i++) {
var entry = json.feed.entry[i];
var alturl;

for (var k = 0; k &lt; entry.link.length; k++) {
if (entry.link[k].rel == &#39;alternate&#39;) {
alturl = entry.link[k].href;
break;
}
}
var li = document.createElement(&#39;li&#39;);
var a = document.createElement(&#39;a&#39;);
a.href = alturl;

if(a.href!=location.href) {
var txt = document.createTextNode(entry.title.$t);
a.appendChild(txt);
li.appendChild(a);
ul.appendChild(li);
}
}
for (var l = 0; l &lt; json.feed.link.length; l++) {
if (json.feed.link[l].rel == &#39;alternate&#39;) {
var raw = json.feed.link[l].href;
var label = raw.substr(homeUrl3.length+13);
var k;
for (k=0; k&lt;20; k++) label = label.replace(&quot;%20&quot;, &quot; &quot;);
var txt = document.createTextNode(label);
var h = document.createElement(&#39;b&#39;);
h.appendChild(txt);
var div1 = document.createElement(&#39;div&#39;);
div1.appendChild(h);
div1.appendChild(ul);
document.getElementById(&#39;data2007&#39;).appendChild(div1);
}
}
}
function search10(query, label) {

var script = document.createElement(&#39;script&#39;);
script.setAttribute(&#39;src&#39;, query + &#39;feeds/posts/default/-/&#39;
+ label +
&#39;?alt=json-in-script&amp;callback=listEntries10&#39;);
script.setAttribute(&#39;type&#39;, &#39;text/javascript&#39;);
document.documentElement.firstChild.appendChild(script);
}

var labelArray = new Array();
var numLabel = 0;

<b:loop values='data:posts' var='post'>
<b:loop values='data:post.labels' var='label'>
textLabel = &quot;<data:label.name/>&quot;;

var test = 0;
for (var i = 0; i &lt; labelArray.length; i++)
if (labelArray[i] == textLabel) test = 1;
if (test == 0) {
labelArray.push(textLabel);
var maxLabels = (labelArray.length &lt;= maxNumberOfLabels) ?
labelArray.length : maxNumberOfLabels;
if (numLabel &lt; maxLabels) {
search10(homeUrl3, textLabel);
numLabel++;
}
}
</b:loop>
</b:loop>
</script>
</div>

</div>
</b:if>
Note :
If your blog using the code read more then there is usually a two code <data:post.body/> Put the above code in the code first.
READMORE

How to Add Meta Tag to Blogger

Why should I add metatags on the blog? good question, so the blog can be found on search engines are supposed to apply these tips in your blog that you have to blog more Search Engine friendly.

How to add Meta Tag to blogger :
* first login to blogger chose Design
* go to Edit html
add metatag* find this code
<b:include data='blog' name='all-head-content'/>
* put this code under code above
<meta content='DESCRIPTION HERE' name='description'/>
<meta content='KEYWORDS HERE' name='keywords'/>
<meta content='AUTHOR NAME HERE' name='author'/>
see example here :
add metatagDon't forget to add description and keywords and save it.

another tips to make metatag you can use add me (http://www.addme.com/meta.htm) to make metatag generator.
READMORE

Outomatic Read More on Your Blog

In post something in the blog, sometimes creating blogs become so long that they are not tasty for the look. To shorten so that all the blog posts seem all the necessary restrictions on the sentence to be more professional blogs.

In a sentence limitation in the post needs to add the Read more, the blog not too long so it does not take place. Here I am trying to give on how to add read more automatically into the blog.

* first log into blogger
* click edit html
* check Expand Widget Template
* find code </head> (for fast find ctrl + F)
* put this code above </head>

<script type='text/javascript'>
var thumbnail_mode = &quot;float&quot; ;
summary_noimg = 300;
summary_img = 250;
img_thumb_height = 50;
img_thumb_width = 50;
</script>

<script type='text/javascript'>
//<![CDATA[
/******************************************
Auto-readmore link script, version 2.0 (for blogspot)

(C)2008 by Anhvo

visit http://en.vietwebguide.com to get more cool hacks
********************************************/
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}

function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {

imgtag = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" /></span>';
summ = summary_img;
}

var summary = imgtag + '<div>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
div.innerHTML = summary;
}
//]]>
</script>
* click save template
* find code <p><data:post.body/></p> and change it to this code
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id' style='text-align: justify;'>
<p><data:post.body/></p>
</div>
<script type='text/javascript'>
createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);
</script>
<a expr:href='data:post.url' style='float:right;padding-top:10px;'>[Read More...] - <data:post.title/></a>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<p><data:post.body/></p>
</b:if>
* click save template, and see your blog post.
READMORE

Monday, August 16, 2010

How to Make Blog using Blogspot

How do I create a blog that is very easy, the answer is to use a free blog facility provided by the blogger. To create a blog using blogger is not difficult because it is easier and can be done by anyone, although not understood at all with the script code confusing.

In creating a blog to keep in mind is the first time you have to have an email from Google (Gmail), it's so much easier later to create a blog.

First of all open Blogger, then fill in your email address (Gmail) and password have been created.
bloggerfollow the instructions via this video to simplify how to create a blog.


it's easy isn't it.
READMORE