- This topic has 11 replies, 3 voices, and was last updated 7 years, 2 months ago by Leo.
-
AuthorPosts
-
February 2, 2017 at 10:21 am #273370Brianna
alright, I researched how to get my social media icons to show up in the menu bar when you’re on a mobile phone. I inserted the .php code.
that’s all working fine.
However, I have social media Icons in my menu bar in desktop mode. And when it switches to mobile view the icons remain there but now muddy up the drop down menu. I cannot for the life of me find any forum topic that covers this.
What I want to do: remove the social media icons in the drop down menu bar when I’m on my site in mobile mode. Because they’re already embedded in the menu .php.
I did manage to find a CSS code in direct response to someones question in the forum: But it doesn’t work.
@media screen and (max-width: 770px) {
.social_icon {
display: none;
}
}.Does that make sense?
February 2, 2017 at 10:26 am #273372LeoStaffCustomer SupportMaybe try this?
@media (max-width: 768px) { .main-navigation .sf-menu>li.social_icon { display: none !important; } }
If this doesn’t work can you provide a link to the site?
February 2, 2017 at 1:09 pm #273449TomLead DeveloperLead DeveloperThe above should work, just make sure your icons have the social_icon class: https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
February 2, 2017 at 7:55 pm #273612BriannaAhhhh there’s a hiccup… The CSS class of my social media Icons are already being used: menu-item-float-right
My website is http://www.BVKingsley.com if you need to check it out.
It’s okay if I have to choose between having my social icons on the left side of the desktop screen and having them on the drop down menu on the phone. I was just wonder.
Also, been using GP for a year now. Still in love with the entire thing.
February 2, 2017 at 8:10 pm #273617LeoStaffCustomer SupportYou can add as many CSS classes as you want. Just separate them by a comma 🙂
Let me know if it works out.
Glad you are still loving GP!
February 2, 2017 at 8:25 pm #273620BriannaI doesn’t work. When I hit save, the CSS class bar removes the comma
February 2, 2017 at 8:32 pm #273621LeoStaffCustomer Supportsorry you actually don’t need a comma, just a space.
February 2, 2017 at 8:34 pm #273622LeoStaffCustomer SupportI can see the classes now.
I think you added the class as
social-icon
but it needs to besocial_icon
February 2, 2017 at 8:41 pm #273628BriannaFixed it to social_icon, still didn’t work.
Lets review in case i got the steps wrong. I put the chunk of code
@media (max-width: 768px) {
.social_icon {
display: none !important;
}
}into my simple CSS plugin and hit save. I then went appearance > Menu and went to my social media menu items. I added a space next to menu-item-float-right and inserted social_icon. I hit save. I then went to the website on my phone and nothing changed.
I’m probably missing something here.
February 2, 2017 at 8:48 pm #273635LeoStaffCustomer SupportAhh looks like we weren’t specific enough as it got overwritten.
I edited the code above (https://generatepress.com/forums/topic/social-media-icons-in-mobile-view/#post-273372).
Can you give it another shot?
February 2, 2017 at 9:07 pm #273641BriannaAH HA! You did it, it now works, thanks LEO for walking me through it!
February 2, 2017 at 9:18 pm #273648LeoStaffCustomer SupportYou’re very welcome!
-
AuthorPosts
- You must be logged in to reply to this topic.