Skip to main content

Add Adsense or Html Gadget in either Mobile or Desktop Version of Blogger Themes



In this post, I will explain how to easily show any Gadget, only in Mobile or Desktop in all Blogger Themes, including the latest default Notable, Soho, Contempo, Emporio, and Essential Themes.

This simple Conditional Code will enable you to show any Gadget, including the Adsense Gadget or Adsense Code that has been directly added inside the Blogger Body in an Html Gadget either in the Mobile or Desktop versions of the Blogger Blog.

Edit Template and jump to the widget:

For example if you have added the  adsense code in an Html Gadget and want to show it only in mobile devices, then add this conditional tag:

<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'>

/b:if>


See Example of adsense code added in an Html Gadget with the Mobile Only conditional tag:

<b:widget id='HTML1' locked='false' title='' type='HTML' version='2' visible='true'>
<b:widget-settings>
<b:widget-setting name='content'><![CDATA[<script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" ></script><!—Add Name--><ins class="adsbygoogle" data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" data-ad-format="auto" data-ad-slot="xxxxxxxxxx" data-full-width-responsive="true" style="display: block;"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({});</script>]]></b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<b:if cond='data:blog.isMobileRequest == &quot;true&quot;'>
<b:include name='widget-title'/>
<div class='widget-content'>
<data:content/>
</div></b:if>
</b:includable>

Example of Adsense Default Adsense Gadget with Mobile-only conditional tag:

If you have added the Default Adsense Gadget in the Blogger Theme and want to show it only in the Mobile version, then refer to the example shown in the image given below.

Mobile only conditional tag for Blogger Themes

If you wish to add the Html Gadget along with the adsense code only in the Desktop version of your site, then add this conditional tag:

<b:if cond='data:blog.isMobileRequest != &quot;true&quot;'>

</b:if>


See Example of adsense code added in Html Gadget and shown only in Desktop version:

<b:widget id='HTML3' locked='false' title='' type='HTML' version='2' visible='true'>
<b:widget-settings>
<b:widget-setting name='content'><![CDATA[<script async="async" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" ></script><!-- Below Header-Desktop --><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" data-ad-slot="xxxxxxxxxx" data-ad-format="auto" data-full-width-responsive="true"></ins><script> (adsbygoogle = window.adsbygoogle || []).push({});</script>]]></b:widget-setting>
</b:widget-settings>
<b:includable id='main'>
<b:if cond='data:blog.isMobileRequest != &quot;true&quot;'>
<b:include name='widget-title'/>
<div class='widget-content'>
<data:content/>
</div></b:if>
</b:includable>

Example of Adsense Default Adsense Gadget with Desktop only conditional tag:

Blogger conditional tag for Desktop Theme

The same procedure can be used to show any other Gadget either in the Mobile or Desktop versions of your Blogger Blog.

Comments

Popular posts from this blog

DIRECT REALISATION

(1)I bow to that Ṣrî Hari (Vishṇu), the infinite bliss, the Teacher, the Supreme Lord, all-pervading, the prime-cause of all the worlds. Direct realisation is herein expounded as a means to liberation. It should be studied, again and again, with great effort, only by the wise. (2) By following the duties of one's own caste and order, by asceticism and by the propitiation of Hari, men will gain the four-fold requisite of freedom from desires, etc. (3) Spotless freedom from desires means such a dissatisfaction in respect of all objects from Brahman down to the inanimate as is felt in respect of the excrement of a crow. (4) Discrimination of the real means the determination that the nature of the self is eternal while, all that is perceptible is otherwise (5) The constant eradication of mental impressions is called control of mind. The restraint of external activities is called control of body. (6) Extreme abstention is the turning away from the objects of enjoyment. The

Symbol of the Indian Rupee

Udaya Kumar, a post graduate in Design from Indian Institute of Technology Bombay has designed the symbol of the Indian Rupee. This symbol has come into effect from 15th July, 2010.  The symbol is an amalgam of Devanagari "Ra" and the Roman Capital "R" with two parallel horizontal stripes running at the top representing the national flag and also the "equal to" sign.

National Emblem of India

The four lions which stand for power, courage, pride and confidence, these four lions resting on a circular abacus girded by four smaller animals who are the guardians of the four directions, lion of the north, the elephant of the east, the horse of the south and the bull of the west make up the National Emblem of India.  At the bottom is inscribed 'Satyameva Jayate' meaning’ truth alone triumphs'.