Conditionals are codes that indicate where something should be executed and where it should not be executed. That is, conditions an order.
In this way we can make a script, a video, an image, a gadget, a message, a trick, styles, etc. is displayed only on the blog cover, or only in the entries, or only on the static pages, or only in the lists of files, or in a specific entry.
Using them is simple, there is only to put at the beginning of the element that we want to condition the code that specifies and conditions where it will be displayed, and at the end of this the closing of the label.
Show / run an item only on the blog cover
<b:if cond='data:blog.url == data:blog.homepageUrl'>
...Here goes the element code...
</b:if>
Show / execute an item only on individual entries
<b:if cond='data:blog.pageType == "item"'>
...Here goes the element code..
</b:if>
Show / run an item only on the pages of the blog file
<b:if cond='data:blog.pageType == "archive"'>
...Here goes the element code...
</b:if>
Show / run an item only on static pages
<b:if cond='data:blog.pageType == "static_page"'>
...Here goes the element code...
</b:if>
Show / execute an element in a specific entry or specific label
<b: if cond = 'data: blog.url == & quot; URL of the entry or tag & quot;'>On the contrary we can also specify that it be shown everywhere except in a specific place.
... Here goes the code of the element ...
</ b: if>
Show / run an item on all LESS pages on the blog cover
<b: if cond = 'data: blog.url! = data: blog.homepageUrl'>
... Here goes the code of the element ...
</ b: if>
Show / execute an item on all LESS pages in individual entries
<b: if cond = 'data: blog.pageType! = & quot; item & quot;'>
... Here goes the code of the element ...
</ b: if>
Show / run an item on all LESS pages in the pages of the blog file
<b: if cond = 'data: blog.pageType! = & quot; archive & quot;'>
... Here goes the code of the element ...
</ b: if>
Show / run an item on all LESS pages on static pages
<b: if cond = 'data: blog.pageType! = & quot; static_page & quot;'>
... Here goes the code of the element ...
</ b: if>
Show / run an item on all LESS pages in a specific entry or specific tag
<b: if cond = 'data: blog.url! = & quot; URL of the entry or tag & quot;'>
... Here goes the code of the element ...
</ b: if>
Where it says ... Here goes the code of the element ... you add what you want to condition, for example the script, the trick code, or the styles.
For example, for the sidebar to have a different background color only on the blog cover, this code would be used before </ head> as follows:
That would make the sidebar have a blue background color on the cover but when on any other page change to the normal color of the template.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<style type='text/css'>
#sidebar-wrapper {
background: #0080FF;
}
</style>
</b:if>
In this way we condition the way the blog will look according to the page where it is.
As I mentioned before, it can be done for an endless number of things, from a simple style to conditioning a whole container like the sidebar.
In the case of gadgets visit this and this entry to see where the conditionals are placed.
If you want to know more about the topic of conditional codes I recommend this entry of Vagabundia where JMiur has a magnificent and detailed explanation on the subject.