When you add a widget (or a gadget as Blogger would call it) to your blog, by default the widget would appear on all pages –homepage, index, archive, post and static pages. But what if you want a certain widget to appear only on a certain page or pages, can it be done? In other words can you select on which page/pages the widget would or would not appear? The answer is yes you can -by using Blogger conditional tags. Note: This trick doesn't work with Labels, Archive and Followers gadgets. For these gadgets you want to use the CSS's display none method.
Let us proceed,
1. Find your widget or section Id
To address a widget or a section in HTML, you need to know its Id. Here’s how to find a widget or section Id. In url of the widget, you will get widget id like HTML4
2. Locate the widget code in HTML
Go to Dashboard > Design > Edit HTML.
Check the Expand Widget Templates check box on top right of the HTML window.
Find your widget in the HTML by using Ctrl+F and entering the widget Id in the search box.
Your widget code might look like this. It may be a little different, but it’s okay. Just pay attention to the highlighted lines. Widget content is contained in between those two lines -in "includable" section.
<b:widget id='WidgetID' locked='false' title='Widget title' type='HTML'>
<b:includable id='main'>
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:includable>
</b:widget>
3. Choose the appropriate conditional tag
I listed some conditional tags in another post -Targeting specific pages with conditional tag. Copy your desired tag from there and apply it here.
4. Apply the tag
Paste the tag (from step 3) immediately after <b:includable id='main'> and the code line 11 to 15 immediately before </b:includable>, as shown below.
<b:widget id='WidgetID' locked='false' title='Widget title' type='HTML'>
<b:includable id='main'>
PUT CONDITIONAL TAG HERE
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
<b:else/>
<style type='text/css'>
#WidgetID {display:none;}/*to hide empty widget box*/
</style>
</b:if>
</b:includable>
</b:widget>
Replace WidgetID in line 13 with the widget ID from code line 1.
The code will check whether the condition is true or false:
If the result is true, it executes (and display) the widget’s content.
If the result is false, it skips the content and hide the widget.
You need to hide the widget because in most templates the content-less widget will still appear -as an empty box.
5. Save and view
Click Save Template button and view your blog.
Display/Hide Blogger Widget on Specific Pages in Blogger
Tuesday, June 26, 2012Posted by Education at 4:51 AM 0 comments
Labels: Blogger Widget, Display Blogger Widget, Hide Blogger Widget
Ads will display only at post page
Sunday, May 6, 2012
/* Ads will display only at post page */
<b:if cond='data:blog.pageType == "item"'>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_host = "pub-xxxxxxxxxxxxxx;;
/* 336x280, created */
google_ad_slot = "xxxxxxx";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</b:if>
=========================
/* conditional code */
<b:if cond='data:blog.url == data:blog.homepageUrl'>
conditional code
</b:if>
======================
/* widget will only display at home page */
<b:widget id='WidgetID' locked='false' title='Widget title' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'> //insert condition here
<b:if cond='data:title != ""'>
<h2 class='title'><data:title/></h2>
</b:if>
<div class='widget-content'>
<data:content/>
</div>
<b:include name='quickedit'/>
</b:if> //End condition here
</b:includable>
</b:widget>
Posted by Education at 3:59 AM 0 comments
Labels: Google Adsense
Tricks to Approve Adsense Code
Monday, April 30, 2012
- Register at Indyarocks here: Register with Indyarocks.
- Create your profile also make your profile look attractive.
- 50% of your profile must be completed (but 60% above recommended)
- Upload your profile image ( it is Strongly recommended upload your own picture)
- Upload minimum 10 any photos to your album and set visible to everyone.
- Write 2 or more blogs originally content with english language and don’t forget set visible to everyone and add related tags.
Posted by Education at 11:01 AM 0 comments
Labels: Adsense Code Approval, Adsense Tricks, Google Adsense
Does Google Use Data from Social Sites in Ranking?
Tuesday, November 15, 2011
Hello Matt, a recent article of Danny Sullivan suggests that Google uses Twitter and Facebook links as a ranking signal. Can you confirm this? Can you elaborate a little bit more on this? -WebSEOAnalytics
Posted by Education at 5:31 AM 0 comments
Labels: Social Sites Ranking
Difference between Google webmaster and Google analytic tool
Saturday, July 2, 2011
With Google Analytics, we can gather, view, and analyze data about our website traffic (Organic, paid and referral). It generates detailed statistics about visitors to our website. It helps to strengthen your marketing initiatives and create higher converting websites.
Google Webmaster Tools is a free service provided by Google to help new and experienced webmaster check on their indexing and raise the visibility of their website(s). The range of tools offered on Google Webmaster Tools can help webmasters significantly raise their profile by search engine optimization and traffic generation.
Posted by Education at 3:36 AM 0 comments