Archived topic
lightweight social icons using generate_inside_navigation hook
13 replies · Started by Marcus on January 17, 2018
Is there a way to use the "lightweight social icons" plugin inside of the global navigation? I was assuming it might involve the generate_inside_navigation hook?
I'm trying to have: [LOGO (left)] ------ [Navigation + Lightweight Social Icons (right)]
Essentially all on one line in the header, logo left; navigation and lightweight social icons right.
Thank you!
Hi there,
Using FontAwesome should be a better method: https://docs.generatepress.com/article/adding-icons-to-menu-items/
Thank you! I actually had looked at that technique you linked to earlier today, but wanted to take advantage of the ease of use of lightweight social icons plugin instead if possible.
That would actually complicate things which is why we've written that article :)
It should be relatively easy if you follow the steps but definitely let me know if you get stuck somewhere.
I was able to add the shortcode via the Widget Shortcode plugin and this hook:
add_action( 'generate_inside_navigation','addnavshortcode' );
function addnavshortcode() {
echo do_shortcode( '[widget id="lsi_widget-2"]' );
}
?>
However, the icons appear above the navigation and not to the right side as I hoped they would. I guess some CSS is in order?
Hmm try wrapping it in a div with a class then use CSS to float: right;
Thank you for the help Leo. I think the float right will work if I can figure out how to make the container a little wider? So close!
The site container? Should be here: https://docs.generatepress.com/article/container-width/
No, it looks like the "nav#site-navigation.main-navigation" is what is too narrow. It's causing the last link, "CONTACT", to be pushed down. Wondering if that container could extend out more to the left to make room for the social icons.
https://www.screencast.com/t/0RLnSQ6XcnqT
Thank you for all the help Leo!
Can you link me to the page?
I have this running locally via Flywheel right now, but this live link should let you take a look.
Thank you Leo!
Try adding this CSS:
#primary-menu {
float: left;
}
Brilliant! Yes, that's what I needed!
Thank you Tom!
Thank you Leo!
Glad we could help :)