How to remove widget from sidebar on mobile devices

How to remove widget from sidebar on mobile devices

Postby admin » Tue May 16, 2017 6: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 there is a false accusation made against you, then remove this fake report.

Shopping for a new website? See our design deals.

How much is your website worth? Get a free estimate.

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
  2. Post a review.- Posting a good review about this site could help us provide improved support.

Thank You!
User avatar
Site Admin
Posts: 495
Joined: Sun Jan 12, 2014 11:18 pm
Location: New York City

Return to WordPress

Who is online

Users browsing this forum: No registered users and 0 guests