- This topic has 13 replies, 5 voices, and was last updated 6 years, 7 months ago by
Fernando Díaz Gascón.
-
AuthorPosts
-
August 10, 2016 at 5:27 am #217129
Fernando Díaz Gascón
Hello,
I have made the social networks icons using the secondary menu, but I would like them to show also in mobile. When I see them in mobile I see the navicon, but I would like to see directly the icons.
Some way to do this?
Thanks in advance.
August 10, 2016 at 6:09 am #217137Roberto Enrique
Can you please share an screenshot of what you’re trying to accomplish?
August 10, 2016 at 7:37 am #217157Fernando Díaz Gascón
This is the current appearance: http://subefotos.com/ver/?be1c56188e544632f3dc3c2f7465fd6ao.png
This is what I want: http://subefotos.com/ver/?b69684ef0f7bd33bdeaab0364c6ce916o.png
Thanks in advance!
August 10, 2016 at 8:26 am #217164Craig
following this thread
August 10, 2016 at 8:34 am #217165Roberto
This is better done with gp-hooks add-on.
Right now I’m on the cellphone, tonight, if no one gives you a solution, as soon as I arrive to my home I’ll post what I use.
You can see something similar here
August 10, 2016 at 8:47 am #217172Fernando Díaz Gascón
August 10, 2016 at 9:14 am #217176Tom
Lead DeveloperLead DeveloperRoberto’s solution looks awesome.
If you want to use the navigation and not have it collapse on mobile, this might help: https://generatepress.com/forums/topic/secondary-navigation-on-mobile-question/#post-120014
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 10, 2016 at 9:46 am #217180Fernando Díaz Gascón
Thanks Tom. I have it almost. With your solution I can get in mobile screens the social icons in the right side and in a column. Is it possible to get them centered and in a row, only for narrow screens?
Waiting also for Roberto solution to see another way.
August 10, 2016 at 11:24 am #217198Craig
Hey Fernando, I was just saying I was following this thread, hoping to see updates. Thx.
August 10, 2016 at 12:58 pm #217224Stacey Usborne
StaffCustomer SupportCan you post a link of what you have so far?
I think it might help tom come up with a solution for you 🙂
August 10, 2016 at 10:15 pm #217328Roberto Enrique
Ok, here is what i do:
I create a list of icons manually and place it in the wp_head hook (don’t know if it is the best hook use, but it works):<div class="social-bar"> <div class="grid-container"> <ul class="social-list"> <li><a href="http://www.facebook.com/"><i class="fa fa-facebook"> </i> <span class="hide-on-mobile">Facebook</span></a></li> <li><a href="http://www.twitter.com"><i class="fa fa-twitter"> </i> <span class="hide-on-mobile">Twitter</span></a></li> <li><a href="http://www.pinterest.com"><i class="fa fa-pinterest"> </i> <span class="hide-on-mobile">Pinterest</span></a></li> </ul> </div> </div>
As you can see I’m using unsemantic’s “hide-on-mobile” class to hide the text strings labels on mobile
And this is the CSS
.social-bar{ background-color:#bde2ff; padding:10px 0; } .social-list { list-style: outside none none; margin:0; } .social-list li{ display: inline; margin-left:0.5em; } @media screen and (max-width: 768px) {/*mobile*/ .social-bar { text-align: center; } }
and that’s it, you can add as many icons you want like that and control how they look easily 🙂
you can see the demo here:
August 11, 2016 at 12:37 am #217340Tom
Lead DeveloperLead DeveloperNice, great job!
One tip – wp_head is meant for scripts. I would definitely suggest placing it inside the “Before Header” hook as that will place it within the
<body>
element where HTML should be.Thanks for sharing your code, Roberto! Super helpful 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 11, 2016 at 12:57 am #217349Roberto Enrique
That’s right, before header is the right place.
August 11, 2016 at 3:14 am #217382Fernando Díaz Gascón
Definitely, a great solution. Thanks Roberto and thanks to all.
-
AuthorPosts
- You must be logged in to reply to this topic.