Home>Support>How to show Advertisement widget only on mobile devices

How to show Advertisement widget only on mobile devices

Hi,
Great plugin (Y) Easy to use and simple to configure! but i am have difficulty to find out about how can i show some advertisement widgets only on mobile device and some only on desktop devices. Will widget logic plugin work with it? or is there a better way to do that? I will be very grateful for your help.

Thanks.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 7 years, 11 months ago Alex S
    Hi, I Work Here

    Hi Floria,

    You can do this with a widget class and some custom CSS. Please open the advertisement widget and head over to the widget styles sidebar. Open the Attribute settings group and set the Widget Class as mobile-show then save the page.

    Please navigate to WP AdminAppearanceCustom CSS and add the following CSS:

    .mobile-show {
    	display: none;
    }
    @media (max-width: 767px){
    	.mobile-hide {
    		display: none; 
    	}
    
    	.mobile-show {
    		display: block;
    	}
    }
    

    The above CSS will allow for the widget to appear on tablet and mobile devices. If you would like to show it on less devices, simply decrease the max-width amount. This CSS will also allow you to hide widgets on mobile by adding mobile-hide as the widget class.

    You might also need to install the SiteOrigin CSS Editor.

    I’m unfamiliar with Widget Log so I personally can’t comment on it out of fear of incompatibility – I’ll run some tests with it soon.

  2. 7 years, 10 months ago Jeffrey Carandang

    Hi Floria,

    You can use Widget Options plugin : https://wordpress.org/plugins/widget-options/ which is way more better than widget logic. Widget Options is now compatible with SiteOrigin Pagebuilder and you can hide any widgets on certain devices easily. Please refer to screenshot below and I hope this will be very helpful.

    Cheers,
    Jeffrey

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More