- This topic has 9 replies, 3 voices, and was last updated 6 years, 11 months ago by Tom.
-
AuthorPosts
-
April 20, 2017 at 4:59 pm #308314Bobby
Hi Tom,
I have quite an odd question. Eventhough I know Generate Press is a responsive theme, I’m still trying to use it as if it’s not….but dont ask me why? LOL.
Here’s my scenario…I’m trying to use a second copy of generate press for the mobile version of my site. So I have the first, orginal copy loaded for the desktop look and I’m trying to customize a second copy for the mobile look. Im using a mobile theme switcher plugin to do this. My problem is…when I remove the right sidebar from the second mobile version of GP, it also removes the right sidebar from my desktop copy. I don’t understand why because I have both themes named differently to function separately. One copy is named just “Generate Press” and and second mobile copy is named “Generate Press Mobile.” I even changed the names on the style sheets. How can I make these two copies function and look separately?
Thanks
April 20, 2017 at 9:08 pm #308383TomLead DeveloperLead DeveloperHi there,
The GP settings are stored inside a specifically named option inside the DB, which is why the two themes are sharing the settings.
You would have to use a function in that second theme: https://docs.generatepress.com/article/sidebar-layout/#using-a-function
Any particular reason you’re using two separate theme folders instead of just tweaking the one theme on mobile?
April 21, 2017 at 5:21 am #308494BobbyHi Tom,
I basically run different ad networks between desktop version and mobile version and when the sidebar drops down under the post, I do not want to show the content in the sidebar. I know I probabably could use css queries, but I did not feel like learning it and setting it all up.
I just want to remove the right sidebar totally on the mobile version. I think that would solve my problem.
I did a css “display: none” on the sidebar….it removed the sidebar, but the sidebar space area is still there.How can I remove the sidebar and also have the main post content stretch over to full width? Do you know of a quick php function that would do this?
Thanks.
April 21, 2017 at 10:21 am #308618TomLead DeveloperLead DeveloperHi there,
Try this:
@media (max-width: 768px) { .sidebar { display: none; } .content-area { float: none; width: 100%; left: 0; right: 0; } }
April 21, 2017 at 10:58 am #308637BobbyThat worked perfectly. Thanks so much Tom.
April 21, 2017 at 11:29 am #308639TomLead DeveloperLead DeveloperYou’re welcome 🙂
May 1, 2017 at 2:03 am #312466RomanHi Tom, what about if I have two sidebars and the content like 55-20-25% and I want to hide sidebars at two different breakpoints respectively while mainteining the visible part 100% width? For example:
above 1300px 55-20-25
@1300px 75-0-25
@760px 100-0-0Thanks
RomanMay 1, 2017 at 9:56 am #312587TomLead DeveloperLead DeveloperHi Roman,
You would do something like this:
@media (max-width: 1300px) { .content-area.grid-55 { width: 75%; } #left-sidebar { display: none; } } @media (max-width: 760px) { .sidebar { display: none; } }
May 3, 2017 at 12:12 am #313247RomanHi Tom,
Thank you for your suggestions. Actually I went with something like this for better responsiveness control:
@media screen and (max-width: 1395px) { .widget-area.grid-20 { width: 21%; } .widget-area.grid-25 { width: 25%; } .content-area.grid-55 { width: 54%; } } @media screen and (max-width: 1335px) { .widget-area.grid-20 { width: 20%; } .widget-area.grid-25 { width: 26%; } .content-area.grid-55 { width: 54%; } } @media screen and (max-width: 1200px) { .widget-area.grid-20 { display: none; } .widget-area.grid-25 { width: 30%; } .content-area.grid-55 { width: 70%; } } @media screen and (max-width: 1000px) { .widget-area.grid-20 { display: none; } .widget-area.grid-25 { display: none; } .content-area.grid-55 { width: 100%; } }
Now I wonder how to move sidebars under main content at particular breakpoints and maybe combine this approach with a/m code.
Thank you again
RomanMay 3, 2017 at 12:45 am #313253TomLead DeveloperLead DeveloperForcing the sidebars below content can be done like this:
.sidebar, .content-area { float: none; width: 100%; left: 0; right: 0; }
-
AuthorPosts
- You must be logged in to reply to this topic.