Friday, March 13, 2009

Show Only Post Title In Blogger Label-Archive-Home Pages

How to Show Only Post Title In Blogger Label page,Archive Pages or even on home page of your blog.You sure would have seen many blogs using this trick to show only there post title in any page they want.Wordpress blogs easily do this using various plugins available but we bloggers also now can make it work in our blogs as its very simple tutorial to implement.

Here is an hack how to show post title in any desired page of an blog.

Please Read this tutorial very carefully as it is very easy but i am telling you two ways of doing which have different results.You can use one way at time or both ways at time but results will be different.I will try to make it very simple for you with what would be the result to the blog with each step, so read carefully.

1.Login to Blogger
2.Go To LAYOUT
3.Then Click On Edit HTML
4.Check Mark Expand Widgets
5.Press Ctrl+F

Now search For below code line in red :-

<b:include data='post' name='post'/>

And Replace it with Below Codes:-


<b:if cond='data:blog.homepageUrl
!= data:blog.url'>

<b:if cond='data:blog.pageType != "item"'>

<h3 class='post-title'><a expr:href='data:post.url'><data:post.title/></a></h3>

<b:else/>

<b:include data='post' name='post'/>

</b:if>

<b:else/>

<b:include data='post' name='post'/>

</b:if>


Now Preview Your template. If it accepts Your Html.Then Save It.

Now open your blog and click on the label or archive page of your blog it will show only post title . For demo check the category page of this Blog.

I hope you will be satisfied with it.This is one way.

Now there is another way of doing it but the results are different.

If you want to show only title of posts in your blog home page also,then only follow this way and implemet it.If you want only label page to show post title just get stoppd after reading first way only.

Now the second way to show only post title in blogger home page too.

1.Login to Blogger
2.Go To LAYOUT
3.Then Click On Edit HTML
4.Check Mark EXpand Widgets
5.Press Ctrl+F

Now search for this line in red :-

<p><data:post.body/></p>

After finding this line replace it with below codes :-


<b:if cond='data:blog.pageType == "item"'>
<p><data:post.body/></p>
</b:if>


This will show only post title on all pages of blogger including homepage label and archive pages.

One of my reader asked to show post title only in archive pages so i am placing code for him

Just use these codes to replace the above red line in place of above codes.


<b:if cond='data:blog.pageType == "index"'>
<p><data:post.body/></p>
</b:if>


And if you dont want to use post titles in archive pages use archive in place of index in above codes that's the only word making basic difference between the codes.

*Note-If you are using read more hack in your blogger you will get above red line twice.So replace only the line that appears first in your blog html code and leave second one as it is.

And then preview your template,if its ok. Save It.

The result would be like this in your blog.

Now i will explain difference in both hacks,so dont get confused.

1)Using only 1st way show post title in only label pages and archive pages.
2)Using only second way will show post title in your blog home page and label pages too but the result in label pages is not so beautiful as it shows Post footer links too like it shows in home page.
3)Install both ways in your blog together if you want to show post title in all of your blog pages and give it beautiful look, like have done it in my Earn Money Blog.

I hope now it have been clear how to use both, if still confused just implement 1st way and if you want post title in home page also implement 2nd way also. Thats' it.
If still any problem leave your comments.

Good Luck !!!!

No comments:

Post a Comment