Mar 4, 2013

Using blogger tags to beautify template and creating plugins

Alright, long time without making a post huh.
On today's post i decided on making a simple tutorial on blogger, creating plugins by adding short tags and features to template

Blogger, add link to website

Blogger add link to website plugin Demo: just drop down to post end.
Uisng blogger tags we can get currect url easily.
Go to Blogger > Template > tick Expand widget template and search for:
<b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>
 Above it paste this code:
<span style='color:#666;font-size:11px;font-weight:bold'>Add this post to your website</span>
<textarea onclick='this.focus();this.select()' onfocus='this.select()' readonly='readonly' style='width:100%;outline:none;height:60px;padding-right:12px;color:#333'>
<data:post.title/> | <a expr:href='data:post.url'><data:post.title/></a>
</textarea>
 and you're done

Title tag seo

Using this method you can easily self specify the way the title tag can be shown in the page.
Again go to Blogger > Template > tick Expand widget template and search for:

<head>
At the top (most of cases) you will find this piece of code
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<title><data:blog.pageTitle/> - Web Developement blog, Tutorials on Php, Mysql, Jquery with examples</title>
<b:else/>
<title><data:blog.pageName/> - <data:blog.title/></title>
</b:if>
What it does is, if homepage display some title, if post display post title and page title.
You can easuly costumize it on your own, ex showing only blog post without title (seo), ex:
    <b:if cond='data:blog.pageType == &quot;index&quot;'>
    <title><data:blog.pageTitle/></title>
    <b:else/>
    <title><data:blog.pageName/> - <data:blog.title/></title>
    </b:if>

Adsense tips

Meta keywords

They do not have any seo benefit anymore for most of search engines like google and bing.
The only purpose of using them is defining what type of ad category should be shown on the site, also for showing ads with high CPC(cost per click)
The best tool on finding this keywords is Google keyword tools.
After you got some nice keywords, all of them should not pass 200-500 chars then find the <head> part and below it type:
<meta content='keywords, here' name='keywords'/>

 Showing ads above post

Search for
<data:post.body/>
the second result and above it add your adsense code.
First of all you shoul encode the adsence code the paste it above just like this:
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-ID&quot;;
/* post */
google_ad_slot = &quot;ID&quot;;
google_ad_width = 336;
google_ad_height = 280;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt; &lt;/script&gt;
Hope you like this simple tips i made, also ill create the socond part soon on using blogger template functions.

1 comment: