- This topic has 9 replies, 3 voices, and was last updated 6 years, 2 months ago by
Leo.
-
AuthorPosts
-
September 26, 2017 at 12:47 pm #392450
David
I am building a simple one page site and would like to replace hamburger icon on mobile with social icons and maybe a phone icon? i will no longer need menu as this will be the only page for the site. add icons as custom links to menu? or use social menu? and how do i replace hamburger icon with these?
September 26, 2017 at 3:57 pm #392528Leo
StaffCustomer SupportHi there,
You can use mobile header with this: https://docs.generatepress.com/article/mobile-header/#adding-html-inside-the-mobile-header
And use CSS to hide the toggle:
@media (max-width: 768px) { .main-navigation .menu-toggle { display: none; } }
Adding CSS: https://docs.generatepress.com/article/adding-css/
September 27, 2017 at 12:04 pm #393085David
thank your your response i am not heavily versed in html so i am having trouble finding my mobile header html to insert into the php function. I have an elementor template that inserted with a hook but when doing that i loose functionality of sticky header. that is why i am trying to add icons to customizer header.
September 27, 2017 at 11:38 pm #393311Tom
Lead DeveloperLead DeveloperYou should be able to place your Elementor template inside the hook using the shortcode:
add_action( 'generate_inside_mobile_header','tu_mobile_header_html' ); function tu_mobile_header_html() { ?> <div class="mobile-header-content"> <?php echo do_shortcode( '[your_elementor_shortcode]' ); ?> </div> <?php }
September 28, 2017 at 11:50 am #393725David
Thank you leo and tom both for your hard work and support. This worked perfectly tom! but it got me thinking can i do this with the primary nav or main site header as well if so could you provide me a code snippet to accomplish this? Thanks in advance and keep up the great work!
I am able to get it to show above site header using code below but it doesnt replace existing header just sits above it and does not inherit sticky properties.
add_action( 'generate_header','tu_site_header_html' ); function tu_site_header_html() { ?> <div class="site-header-content"> <?php echo do_shortcode( '[elementor-template id="81"]' ); ?> </div> <?php }
September 28, 2017 at 3:45 pm #393841Leo
StaffCustomer SupportAre you referring to the desktop navigation?
If so this hook should work: https://docs.generatepress.com/article/generate_inside_navigation/
Let me know if this is not what you wanted or if you can’t get the snippet to work.
September 28, 2017 at 6:48 pm #393929David
Thats it leo! perfect problem solved thank you guys so much
September 28, 2017 at 7:39 pm #393946Leo
StaffCustomer SupportGlad we could help 🙂
September 29, 2017 at 3:44 pm #394485David
Now that i have the elementor template as primary navigation a new issue has come up. When initial page load is performed the elementor template flashes un-styled content. For example the default social icons color flashes quickly then my settings are applied.
September 29, 2017 at 4:45 pm #394496Leo
StaffCustomer SupportShould be the same issue here: https://generatepress.com/forums/topic/question-about-hooks-and-my-header-elementor/#post-382818
-
AuthorPosts
- You must be logged in to reply to this topic.