- This topic has 10 replies, 2 voices, and was last updated 1 year, 7 months ago by Ying.
-
AuthorPosts
-
February 22, 2018 at 5:45 am #502746Jacob
Hi Tom,
My ultimate goal is to have a mobile search form either in the mobile head section below top bar or in the mobile main navigation since my regular search form interferes with my mobile head.
I have tried adding a mobile search form via the method described in your article “Adding HTML Inside the Mobile Header” with the help of the code snippet plugin and have copied the provided code into wp_head and replaced “Your mobile header HTML in here” with the snippet shortcut. Unfortunately, the code “add_action( ‘generate_inside_mobile_header’,’tu_mobile_header_html’ );
function tu_mobile_header_html() { ?>” was visible on the page, before the top bar and a second search form appeared before the top bar (also on desktop/laptop). When I click execute php the whole site crashes.How do I include the search form into the mobil main menu or add a search form between top bar mobile main menu? Maybe via the hook generate_inside_mobile_header_menu, but I don’t know how. Thanks in advance for your help and kind regards, Jacob
February 22, 2018 at 9:22 am #503018LeoStaffCustomer SupportHi Jacob,
If I understand correctly, you should just have to activate GP’s navigation search:
https://docs.generatepress.com/article/navigation-search/It will show up in the mobile header by default.
Then we just have to hide it on desktop.
Let me know if this works for you π
February 23, 2018 at 1:32 am #503473JacobHi Leo,
Thanks for the reply. This works and the search magnifying glass appears in the mobile version only. But now the search magnifying glass interferes with the cart text which is positioned at the right side of the mobile menu.
How do I solve this issue?
Thanks in advance
February 23, 2018 at 9:07 am #503864LeoStaffCustomer SupportWould you prefer the cart icon instead of the cart text?
If so make sure the load essential icons only option is not checked here: https://docs.generatepress.com/article/load-essentials-icons/
Let me know if that works for you π
February 25, 2018 at 6:28 am #505100JacobIts unfortunately the same when I untick the ‘load essential fontawesome icons only’ option. The magnifying glass interferes with the shopping cart icon then. Additionally, I would prefer to have the text instead of the icon. One remark because I don’t know if its relevant, the German text for ‘cart’ is ‘Warenkorb’ which is about twice as big. What else can I do to solve this issue? Thanks in advance.
February 25, 2018 at 11:45 am #505356TomLead DeveloperLead DeveloperThe overlapping is a current bug, which is fixed in the next version.
For now, give this CSS a shot: https://generatepress.com/forums/topic/odd-display-error-on-two-websites/#post-473651
Let me know π
February 26, 2018 at 3:13 am #505764JacobNow it works, thanks a lot for your help guys. I will remove the CSS with the next update, correct?
February 26, 2018 at 9:04 am #506082LeoStaffCustomer SupportYup that’s correct π
August 18, 2022 at 2:43 pm #2317007MaryI used this to add the search icon on mobile and it worked great. (yipee!) Now how do I hide it on desktop as I already have a search icon?
August 18, 2022 at 3:15 pm #2317014MaryI removed the search icon from the top menu, but now it’s off center. Is there a way to center it?
Also, my mobile menu is not showing on mobile. (my main menu is) Is there a way to change that?August 18, 2022 at 4:34 pm #2317052YingStaffCustomer SupportHi Mary,
This topic is quite old, I’m not sure if this is the best solution for today.
Can you open a new topic and link us to your site? We’ll be happy to take a look!
-
AuthorPosts
- You must be logged in to reply to this topic.