Show 1st Widget In Sidebar Before Content On Mobile

This code removes all widgets from the sidebar on mobiles except the first widget which is shown before the content like this :

Video Demo

The video shows 3 widgets in the primary sidebar on desktop and only the first widget displaying on mobile.

It doesn’t matter how many widgets are added in the primary sidebar as the code only shows the 1st widget once the screen width reduces below 1023px or any other width you set in the media queries.

Here’s the code for members:

Related Tutorials

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.