- This topic has 10 replies, 3 voices, and was last updated 4 years, 7 months ago by
David.
-
AuthorPosts
-
August 13, 2021 at 6:47 am #1894517
Reenay
Hello, I am looking for help with repositioning the header. While I found many relevant topics in the forum, one or two things are missing.
Specifically, I wanted to achieve the following:
On Desktop –
First, Off-Canvas Button + Logo (on left) – Main Menu + Search Button (on the right)
Same on Mobile –
Off-Canvas Button/Mobile Menu + Logo (on left) – Search Button (on the right)
The current customization settings of the layout section are:
Use Navigation as Header – ‘NO’
Mobile Header – ‘OFF’
Off-Canvas Panel – ‘ON’I do not wish to use the Mobile Header since it calls an additional CSS file i.e. navigation-branding-flex.min.css
*Using the latest GP theme and premium plugin.
August 13, 2021 at 7:17 am #1894551David
StaffCustomer SupportHi there,
can you share a link to your site and i can look at whats required.
August 13, 2021 at 7:47 am #1894591Reenay
Hi David,
Here is the test site link – https://tn.wpdeve.com/
August 14, 2021 at 1:09 am #1895294Reenay
Hi David,
Any update?
You can also check out the live example of requirements on the main domain i.e. https://wpdeve.com/
Thanx
August 14, 2021 at 5:16 am #1895394David
StaffCustomer SupportTricky one.
First off we’ll need to hook in a custom Off Canvas toggleCreate a new Hook Element:
Add this for the hook content:<?php $icon = ''; if ( function_exists( 'generate_get_svg_icon') ) { $icon = generate_get_svg_icon( 'menu-bars' ); } ?> <span class="slideout-toggle hide-on-mobile has-svg-icon"><a href="#"><?php echo $icon; ?> FILTER</a></span>Then set the hook to
generate_before_header_content
Check the Execute PHP and set your Display Rules to Entire Site.Lets see if we can get that in place first, and that it works. Then we can look at the rest of the layout.
August 14, 2021 at 11:05 am #1895830Reenay
Thanks, David.
I have added the code and also set the priority to 1, now the Off-Canvas Button is starting to appear before the logo.
Pl also look into the rest of the layout for desktop and mobile both.
August 14, 2021 at 12:12 pm #1895895Ying
StaffCustomer SupportHi Reenay,
Then you can try add this CSS to customizer > addtional CSS:
@media (min-width: 769px) { span.menu-bar-item.slideout-toggle { display: none; } } .main-navigation button.menu-toggle { display: none !important; } .inside-header > span.slideout-toggle.has-svg-icon { margin-right: 20px; }And try to modify David’s PHP code to this:
<?php $icon = ''; if ( function_exists( 'generate_get_svg_icon') ) { $icon = generate_get_svg_icon( 'menu-bars' ); } ?> <span class="slideout-toggle has-svg-icon"><a href="#"><?php echo $icon; ?> FILTER</a></span>Let me know if it works 🙂
August 14, 2021 at 1:41 pm #1895918Reenay
Hi Ying,
Thanx for CSS, it is working fine.
However, I just noticed that Main Menu items are not merging with the Off-Canvas menu on mobile.
Ideally, it should. Otherwise, the main menu items will be hidden on mobile.
And, there would be no point of using the Off-Canvas menu on ‘Desktop’, if one has to use the same items as the main menu.
Can you suggest any workaround for that.
P.S. The current theme on the main domain does that flawlessly, check that out.
August 15, 2021 at 4:38 am #1896216David
StaffCustomer SupportCouple of methods:
1. Add the ‘missing’ desktop menu items to your off canvas panel menu. And add the
hide-on-desktopclass to the menu items CSS Classes:https://docs.generatepress.com/article/using-the-wordpress-menu-builder/#custom-classes
2. Use the Off Canvas Panel Widget area to a Navigation Widget.
This will require some CSS to change the order and layout.I would personally go with #1.
August 15, 2021 at 5:25 am #1896254Reenay
Roger that!
Thank you very much for your help.
August 15, 2021 at 6:32 am #1896312David
StaffCustomer SupportGlad we could be of help!
-
AuthorPosts
- You must be logged in to reply to this topic.