Widget display only the pages you choose!

Once you add a widget in your blog, it'll be displayed in every page of it (the home page and each page of message).
But sometimes we want to display a widget, only the home page or only in the pages of messages or even a specific page of the blog.
The configuration of this trick is very simple, but requires that you literally every widget is a name well-Specific for you to find in the HTML code (once you have done this trick you can modify or delete his name ).

Log in to Blogger, Go to "Layout", "Edit HTML" select "To develop models of gadgets," and find (Ctrl + F) the following code:  

 <b: widget id you will find all widgets for your blog.
 
Now locate the widget you want to customize (for example Adsense, ...). Archive The code of your widget should look like this:


<b:widget id='HTML3' locked='false' title='THE NAME OF YOUR WIDGET' type='HTML'>
<b:includable id='main'>
<!-- only display title if it's non-empty -->
<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>



Once you have located the widget, the widget to display only the home page, add the two red line:
 
<b:widget id='HTML3' locked='false' title='THE NAME OF YOUR WIDGET' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<!-- only display title if it's non-empty -->
<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>
</b:includable>
</b:widget>

To display the widget on all pages of your blog, except the home page.
 
<b:widget id='HTML3' locked='false' title='LE_NOM_DE_VOTRE_WIDGET' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.pageType == "item"'>
<!-- only display title if it's non-empty -->
<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>
</b:includable>
</b:widget>
To display the widget in a specific page and only this page of your blog.
 
<b:widget id='HTML3' locked='false' title='LE_NOM_DE_VOTRE_WIDGET' type='HTML'>
<b:includable id='main'>
<b:if cond='data:blog.url == "ENTRER_ICI_UNE_URL_DE_VOTRE_BLOG_http://..."'>
<!-- only display title if it's non-empty -->
<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>
</b:includable>
</b:widget>
 
That should add only the code in red. 

0 commentaires

Enregistrer un commentaire



Inscription à : Publier les commentaires (Atom)