- This topic has 16 replies, 3 voices, and was last updated 2 months ago by David.
March 31, 2020 at 12:44 pm #1221311Vera
I have tried for several hours but have not been able to figure out how to do this:
I have a horizontal main navigation menu and a horizontal secondary navigation menu on all my pages. The secondary menu is at the very top of each page.
On my home (front) page only, I want to set up a hero element with a 300-400px high image below the secondary menu and then my main menu below the hero element. I want the same layout on all my other pages except I want to substitute a different 75-100px high art banner for the hero element.
I can set up the elements but can’t get them to appear between the two menus. Is there a way to do this while having a different treatment on the home page than the other pages?
I would appreciate any help. Thank you!Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4March 31, 2020 at 2:44 pm #1221417LeoStaffCustomer Support
Try this PHP snippet:
Let me know if this helps 🙂March 31, 2020 at 5:22 pm #1221515Vera
Thank you for the quick reply. I tried creating and activating a “code snippet” using the plugin but it had no effect.
Can you tell me where to place the code or snippet? Would it be inside the html box on the hero element (setting) page? I’m reluctant to just experiment and possibly break my site. (I am not a coder.)
Also, I would like the same effect for all my other pages but with different images. I noticed the php code mentions “front page” which suggests it will only work for that.
Thanks again!Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4March 31, 2020 at 5:58 pm #1221542LeoStaffCustomer Support
Code snippets should be the way to go if you aren’t using a child theme already.
If you want that apply to every page then this should be the code:
Let me know 🙂March 31, 2020 at 6:27 pm #1221563Vera
I get this error when trying to activate the snippet:
The snippet has been deactivated due to an error on line 3:
Cannot redeclare function craig_move_navigation.
Also, neither php snippet changes the position of the menu to below the hero.Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4March 31, 2020 at 6:29 pm #1221564LeoStaffCustomer Support
Can you only add this one for now?
Make sure the navigation location is set to below header:
https://docs.generatepress.com/article/navigation-location/March 31, 2020 at 6:51 pm #1221583Vera
It works now — thank you! I did have the menu set to appear below the header. I just had to deactivate the front page snippet and activate the other one. But I still need a different hero on my home page, and with the main menu below it.
I may also eventually want different banner art on different pages of my site. If I set up separate elements with display rules for each banner, will this code snippet still work?Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4March 31, 2020 at 8:27 pm #1221618Vera
Creating separate header elements and setting display options for specific pages does not allow me to use different headers for different sections (groups of pages).Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4April 1, 2020 at 3:03 am #1221853DavidStaffCustomer Support
couple of things:
1. For your Home Page select the
Front PageLocation in your Display Rules.
2. Beware of conflicts. For Example: If you first create a Header Element that is set to
Pages > All Pagesthis will override a second Header set to
Pages > Specific page. For this to work you would Exclude the
Specific Pagefrom your first header elementApril 1, 2020 at 10:07 am #1222438Vera
Thank you for your reply.
I attached images showing the settings for the only headers I currently have set up and the code snippet Leo directed me to for making my main navigation menu display below the banner art — in case that’s having any effect.
My header elements appear to be set up correctly, but the only one that displays the banner art is #2.
The links below are the pages I defined for banner art in their header elements and they are currently the only elements in my site. The numbers reference the red numbers on the image.Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4April 1, 2020 at 2:25 pm #1222722LeoStaffCustomer SupportApril 1, 2020 at 4:05 pm #1222794Vera
Here you go. Anything that isn’t showing in these screenshots is either empty or a default setting. (The IMG button wasn’t working so I had to paste URLs this time.)Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4April 1, 2020 at 5:57 pm #1222885LeoStaffCustomer Support
Is there anything added in the content box?
https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-1-add-the-contentApril 1, 2020 at 7:12 pm #1222914Vera
If you mean the box right above where my screenshot starts, no, there is nothing in that box. I will probably only have an image for now, but one day I would like to put a slideshow there. BTW: Can GeneratePress accommodate that?Usual environment: 9.7” iPad Pro, iOS 13.4+
Desktop: Mac OS 10.15.4April 1, 2020 at 7:39 pm #1222923LeoStaffCustomer Support
Yup you just need to add some HTML comment in there as specified in the second paragraph here:
Let me know if this solves it 🙂
- You must be logged in to reply to this topic.