How to Load Widgets only in Mobile Devices or Desktops in Blogger
Hi to all, in this article I am going to tell you all about how to load widgets only in mobile devices or desktops in blogger easily in just few minutes.
If you want to show any ad in the sidebar only for Desktop users and you don't want that show the ad on mobile devices then you can do that by using blogger conditional tags.
It also helps your website loading and also improve Blogger loading speed by blocking unnecessary codes from being loaded on mobile devices or desktop devices.
So, read the below provided steps carefully and completely to get clear understanding about loading widgets or scripts only in mobile devices or desktops easily without any error.
Now we will discuss how to add this in your blogger website easily without any error or issue.
Here we have few cases i.e.
- Loading scripts or widgets in desktop devices only
- Loading scripts or widgets in mobile devices only
- Loading scripts or widgets in mobile devices or desktop devices only
Loading Script or Widgets in Desktop Devices only
If you want to load the widget only on desktops and not on mobile devices then you can follow below provided process.
First of all you need to create or add a widget or script in your blogger website.
Now you need to open blogger theme editor.
Here you need to press CTRL + F and search for the widget or script you have added.
After you find the script or widget in your theme editor, now you need to add the below provided conditional tag just before the widget Id as per the below image.
cond='not data:blog.isMobileRequest'
Loading Scripts or Widgets in Mobile Devices only
If you want to load the widget only on mobile devices and not on desktop devices then you can follow below provided process.
First of all you need to create or add a widget or script in your blogger website.
Now you need to open blogger theme editor.
Here you need to press CTRL + F and search for the widget or script you have added.
After you find the script or widget in your theme editor, now you need to add the below provided conditional tag just before the widget Id as per the below image.
cond='data:blog.isMobileRequest'
Loading Scripts or Widgets in Mobile Devices or Desktops
Here you can also load any particular widget or scripts or HTML or CSS codes on particular devices like only on a mobile devices or only on desktop device by using blogger If conditions.
Now for loading scripts or widgets only in Mobile use the below conditional tag. Just wrap the code with the if condition.
<b:if cond='data:blog.isMobileRequest == "true"'> <!--Add your script here--> </b:if>
Now for loading blogger scripts or widgets only in Desktop use the below conditional tag.
<b:if cond='data:blog.isMobileRequest == "false"'> <!--Add your script here--> </b:if>
Conclusion
I hope that you all have understood about loading widgets only in mobile devices or desktop devices in blogger website easily without any issue or errors.
If you have any query related to this article, then feel free to ask your query through contact page.