- This topic has 16 replies, 3 voices, and was last updated 3 years, 12 months ago by David.
-
AuthorPosts
-
March 31, 2020 at 12:44 pm #1221311Vera
Hello,
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!
March 31, 2020 at 2:44 pm #1221417LeoStaffCustomer SupportHi there,
Try this PHP snippet:
https://generatepress.com/forums/topic/page-header-image-above-menu/#post-474517Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps 🙂
March 31, 2020 at 5:22 pm #1221515VeraThank 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!
March 31, 2020 at 5:58 pm #1221542LeoStaffCustomer SupportCode 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:
https://generatepress.com/forums/topic/page-header-image-above-menu/#post-288568Let me know 🙂
March 31, 2020 at 6:27 pm #1221563VeraI 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.
March 31, 2020 at 6:29 pm #1221564LeoStaffCustomer SupportCan you only add this one for now?
https://generatepress.com/forums/topic/page-header-image-above-menu/#post-288568Make sure the navigation location is set to below header:
https://docs.generatepress.com/article/navigation-location/March 31, 2020 at 6:51 pm #1221583VeraIt 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?
March 31, 2020 at 8:27 pm #1221618VeraCreating separate header elements and setting display options for specific pages does not allow me to use different headers for different sections (groups of pages).
April 1, 2020 at 3:03 am #1221853DavidStaffCustomer SupportHi there,
couple of things:
1. For your Home Page select the
Front Page
Location in your Display Rules.2. Beware of conflicts. For Example: If you first create a Header Element that is set to
Pages > All Pages
this will override a second Header set toPages > Specific page
. For this to work you would Exclude theSpecific Page
from your first header elementApril 1, 2020 at 10:07 am #1222438VeraThank 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.
1: http://www.marshallart.com/HOME/
2: http://www.marshallart.com/HOME/seminars/human-anatomy/
3: http://www.marshallart.com/HOME/seminars/animal-anatomy/April 1, 2020 at 2:25 pm #1222722LeoStaffCustomer SupportCan you take a screenshot of the page hero settings for #1 the home page one?
April 1, 2020 at 4:05 pm #1222794VeraHere 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.)
http://www.marshallart.com/HOME/wp-content/uploads/2020/04/AC00016B-EEDC-456D-81A5-37BB807E65EE.jpeg
http://www.marshallart.com/HOME/wp-content/uploads/2020/04/60A1EAA5-3E29-4B9B-B7BA-C73CB2D72FE9.jpeg
April 1, 2020 at 5:57 pm #1222885LeoStaffCustomer SupportIs 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 #1222914VeraIf 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?
April 1, 2020 at 7:39 pm #1222923LeoStaffCustomer SupportYup you just need to add some HTML comment in there as specified in the second paragraph here:
https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-1-add-the-contentLet me know if this solves it 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.