As I have shared an Article on yesterday about Add Progress Bar Like YouTube On Blogger.Com Blogs and today I'm going to share an useful Article about What Are Conditional Tags & How To Use Them.
So let's start, actually, Conditional Tags are use in Blogger Template and they use for specify conditions like if you are going to add any widget and you want to appear it only in Homepage then you use conditional tag so it'll only appear in Homepage not in Post Page nor in Label Page.
I hope by this Article you'll understand what are actually Conditional Tags and How to use them?
Here is the look how they appear in your Blogger Template:
<b:if cond='Your-condition'>You have seen that it's started with <b:if> and closing with </b:if> let's suppose you want to add a CSS code in it then it'll will start like :
<!-- Your content here! -->
</b:if>
<b:if cond='Your-condition'>It's starting with <b:if> tag + <style> tag and closing with <style> + </b:if> tag. So you want to add anything you want to appear in specific area then you have to add code in middle of the Conditional Tag.
<style>
<!-- Your CSS Code here! -->
</style>
</b:if>
List Of Blogger Conditional Tags
1. For Homepage
<b:if cond='data:blog.url == data:blog.homepageUrl'>
</b:if>
2. For Post and Static Pages
<b:if cond='data:blog.url == data:post.url'>
</b:if>
3. For Static Page
<b:if cond='data:blog.pageType == "static_page"'>
</b:if>
4. For First Post
<b:if cond='data:post.isFirstPost'>
</b:if>
5. For Posts
<b:if cond='data:blog.pageType == "item"'>
</b:if>
6. For Index Pages - Which Includes : Homepage, Post Page, Archive Pages
<b:if cond='data:blog.pageType == "index"'>
</b:if>
7. For Label & Search Pages
<b:if cond='data:blog.searchLabel'>
</b:if>
8. For Archive Pages
<b:if cond='data:blog.pageType == "archive"'>
</b:if>
9. For Error 404 Page
<b:if cond='data:blog.pageType == "error_page"'>
</b:if>
10. For Specific URL/Page
<b:if cond='data:blog.url == "your-desired-URL"'>
</b:if>
Example Using Conditional Tags
Facebook Like Button code that appear only on post pages, while on the home page, static pages, etc. will be hidden.
I will add this Facebook Like Button below every post then the code will be :
<data:post.body/>I hope you guys have understand about what are Blogger Conditional Tags and how to use them? So try yourself it's pretty simple. Remember me in your prayers if you liked our efforts then don't forget to share it with your friends too. Thanks! Peace & Happy Blogging!
<b:if cond='data:blog.pageType == "item"'>
Facebook Like Button Code
</b:if>
Dear readers, after reading the Content please ask for advice and to provide constructive feedback Please Write Relevant Comment with Polite Language.Your comments inspired me to continue blogging. Your opinion much more valuable to me. Thank you. ConversionConversion EmoticonEmoticon