Digital Marketing Consultant

Reference Links

Visitor's Flag

How to Add "Read more" Function to Blogger

Wednesday, June 27, 2012

In order to add the "Read More" function to a blogger template, we only need to add a few lines of code to our template's HTML.

You can edit your post in Edit HTML mode, and type <!-- more --> where you'd like the jump link to appear.

To add the code for Jump Links functionality to your Blogger template...
Go to Layout>Edit HTML in your Blogger dashboard and ensure you have checked the "Expand widget templates" box.

Then using your browser's search function, locate the following line of code:
<data:post.body/>

Depending on your individual template, you may find this enclosed between tags. We need to leave these tags intact.

If you've added any other "Read more" hacks to your template (or have added other conditional statements to the Blog Posts section), you may discover more than one instance of <data:post.body/>. If this is the case, you need to edit the section which has <b:if cond='data.blog.url != data:blog.homepageUrl> a line or two above this.

Immediately after the <data:post.body/> line, add the following few lines of code:

<b:if cond='data:post.hasJumpLink'>
<div class='jump-link'>
<a expr:href='data:post.url + "#more"'><data:post.jumpText/></a>
</div>
</b:if >


Free Career Predictions

How To Remove AdSense Ads from the Homepage

This post explains how to hide Google Adsense Ads In Home Page And display them only Inside Post pages Alone.

If you want to hide Google Adsense Ads In Home Page ,follow the steps below.

1.Generate Parsed code for your adsense code because we cannot put adsense code directly in the xml.So parse it using AdParser.

After parsing,your ad code Should look like this.


2. Log in to your dashboard--> layout- -> Edit HTML
<data:post.body/>

3.Click on "Expand Widget Templates"

4.Scroll down to where you see this:

5.Now Copy below code and paste it before the above line.
<b:if cond ='data:blog.pageType == "item"'>
<!-- Your AdSense code here -->

</b:if>

Note: You must you must replace with Your Adsense Parsed code.

6.Now save your template and you are done.

Free Career Predictions

Targeting Specific Pages with Conditional Tags in Blogger

Tuesday, June 26, 2012

List of conditional tags
Below is a list of conditional tags that target specific pages.

1. Index (list) pages
<b:if cond='data:blog.pageType == "index"'>
<-- Adsense code here -->
</b:if>

2. Post (item) pages
<b:if cond='data:blog.pageType == "item"'>
<-- Adsense code here -->
</b:if>

3. Static pages
b:if cond='data:blog.pageType == "static_page"'>
<-- Adsense code here -->
</b:if>

4. Archive pages
<b:if cond='data:blog.pageType == "archive"'>
<-- Adsense code here -->
</b:if>

5. Home page
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<-- Adsense code here -->
</b:if>

6. Specific page/url
<b:if cond='data:blog.url == "PUT_URL_HERE"'>
<-- Adsense code here -->
</b:if>

7. Post and static pages
<b:if cond='data:blog.url == data:post.url'>
<-- Adsense code here -->
</b:if>

8. Label-search pages
<b:if cond='data:blog.searchLabel'>
<-- Adsense code here -->
</b:if>

9. First post
This is not a page, but a conditional for the first post. Used for targeting the first post on multi-post pages.
<b:if cond='data:post.isFirstPost'>
<-- Adsense code here -->
</b:if>

Free Career Predictions

Display/Hide Blogger Widget on Specific Pages in Blogger

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.

Free Career Predictions

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>

Free Career Predictions

Related Posts