Archived topic
Different sidebar for mobile and desktop?
1 reply · Started by Sandra on December 22, 2021
Hi,
is it possible to have a different sidebar for desktop and mobile view?
I know that I can disable the sidebar in mobile with CSS like:
@media (max-width: 768px) {
.sidebar {
display: none;
}
}
But to exclude code via CSS is not the best sollution.
So is there any possibility to add a sidebar for desktop and another sidebar for mobile?
Michael
Hi there,
possible yes - but i am afraid it is along the same lines as my reply regarding featured images here:
https://generatepress.com/forums/topic/featured-image-only-on-mobile/#post-2055931
And its more complicated then the featured images as you would need to factor in the different sidebars.
CSS display: none; only really poses a problem if you choose to hide heavy resources such as <img> elements.
Is there a need to swap the entire sidebar ? Or is it just certain widgets that need to be swapped?