Archived topic
Click phone number in mobile navigation without opening the menu
5 replies · Started by Thordis on December 12, 2017
Right now, I am inserting a phone-number and a logo to the mobile menu like this:
add_action( 'generate_inside_mobile_menu','logo' );
function logo() { ?>
<span class="tel"><a href="tel:0234">02234</a></span><span class="logo-mobil"><a href="/home"><img src="/img/logo-mobil.png" /></a></span>
<?php }
This works, but when I click the phone number or the logo the menu opens as well, because these two elements are part of the button.
How can I change this? How can I put these two elements outside the button?
I already tried to use the Mobile Header, but that doesn´t work for me, because I have background-images in the header which don´t show then.
Thanks.
Hi there,
Would you consider using our page header add-on for the front page and merge it with navigation instead of adding the image as header background?
That's the best to achieve the layout you are doing for:
https://docs.generatepress.com/article/page-header-overview/
https://docs.generatepress.com/article/merging-the-page-header-site-header/
Then you can use the default mobile header.
Let me know.
Hi Leo,
I think this won´t work, because I have a different image for each page :-(
That is actually what the new page header is good for.
Simply turn on Add Background image in the page header without adding any image, then it should automatically grab the featured image you upload for each post/page.
Let me know if this answers works for you.
ah, ok -thanks!
That is definitly a great feature, but there is still a problem. The background-image hast to be behind the navigation as well, like seen here: https://screenshots.firefox.com/WWLlZ2Nw7sHIDatg/kunden.perun.net
That's what this article should accomplish: https://docs.generatepress.com/article/merging-the-page-header-site-header/