How to remove widget from sidebar on mobile devices

How to remove widget from sidebar on mobile devices

Postby admin » Tue May 16, 2017 10:41 pm

In this example we hide 'Latest Posts' widget by WP-United from the sidebar on all mobile devices with screens smaller than 959px. The example only works on WP United websites yet the idea can be applied to other widgets, so it's for demonstration purposes only .

To find out your widget, you’ll need to inspect the page’s code and grab the related ID or class to hide a widget. Then you will just replace '.wpulatesttopics' with your id or class.

Go to your WordPress site > wp-content > themes > your-theme > style.css.

Copy and paste the following code:
Code: Select all
/* remove widgets from sidebar on mobile devices */
@media screen and (max-width: 960px) {
.wpulatesttopics { display: none!important; }

WARNING: These changes may be removed if your theme is either updated or upgraded!
The AVNW Support Team

If you wish to add visual documentation (screenshots), make a donation and we'll let you know when the post has been updated

And, if our post has provided you with great information, there are a few ways you can show your appreciation:
  1. Like us on Facebook.- Our account had recently a hacking problem on FB and we were forced to create a new one. We lost all our posts & likes. :(
  2. Send us a testimonial.- Testimonials thanking for our good team work can be valuable to us and may encourage others to seek our support.
  3. Post a review.- Posting a good review about this site could also compel others to seek our advice & support.

Thank You!
User avatar
Site Admin
Posts: 448
Joined: Mon Jan 13, 2014 3:18 am
Location: New York City

Return to WordPress

Who is online

Users browsing this forum: No registered users and 0 guests