Archived topic
Remove sidebar widget from mobile (but not from desktop)
3 replies · Started by Evan on December 2, 2018
Hi again!
Thanks as always for your help. I had a question regarding sidebars on mobile vs desktop.
I have a 4-widget right sidebar on http://www.evantarver.com but I only want three of those four widgets to display on mobile.
Is there a way to remove a sidebar widget from displaying on mobile while allowing it to display on desktop?
Thanks!
- Evan
Hi Evan,
I'm on the About page and only see 3 sidebar widgets currently.
Can you add them all in and let me know which one you want to remove on mobile?
Hi, thanks for the reply -
That's a plugin overriding the default sidebar for the about page specifically, which I want to have three widgets on both desktop and mobile, removing the top image from the default sidebar.
If you look at any of the other pages on desktop, there are four widgets in the default sidebar: an image, categories, newsletter sign up, and another image.
I'd like to remove the first image when displaying on mobile for all sidebars across all posts and pages.
Is that possible to do?
- Evan
Try this CSS:
@media (max-width: 768px) {
.sidebar #widget_sp_image-6 {
display: none;
}
}
Adding CSS: https://docs.generatepress.com/article/adding-css/
Let me know :)