Archived topic
Page header image above menu
26 replies · Started by Craig on March 7, 2017
Hi Tom,
I was wondering if there's any way to get the page image header to display above the menu rather than underneath it?
Hi Craig,
Do you want that image on every page? If so then you can use the before header content hook.
https://docs.generatepress.com/article/hooks-overview/
http://demo.generatepress.com/hook-locations/
Let me know if this is not what you wanted.
Hi Leo,
Thanks for the reply.
I understand I need to use the before header hook, but what I don't understand is what exactly I need to put in there to make the header image display above the main navigation rather than underneath it. Any ideas?
Cheers
So you inserted the image and it shows up below the menu? Can you show me the site?
Hi Leo,
I'm rebuilding a site in GP locally at the moment but I can give you a screenshot.
See the featured header image displays under the main navigation.
What I need is for the featured header image to display above the navigation like it does here - http://www.orabeauty.co.uk/pricelist/
Does that make sense?
*edited
You could try doing something like this:
add_action( 'after_setup_theme','craig_move_navigation' );
function craig_move_navigation() {
remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 );
add_action( 'generate_after_header', 'generate_add_navigation_after_header', 15 );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/
Let me know if this helps or not :)
Try Dashboard > Appearance > GP Hooks and add this in the Before Header Content hook:
<img src="http://IMAGE-URL-HERE"/>
Nailed it Tom! That's exactly what I was trying to do but I don't know much about PHP.
Thanks so much for the support guys :D
Glad we could help :)
Hi Tom,
How could I modify what you posted in reply #288568 so that it only affects the home page?
Paul
Try
add_action( 'after_setup_theme','craig_move_navigation' );
function craig_move_navigation() {
if ( is_front_page () ) {
remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 );
add_action( 'generate_after_header', 'generate_add_navigation_after_header', 15 );
}
}
Thanks, Leo. You rock! Will give it a try.
Leo: per the
Try Dashboard > Appearance > GP Hooks and add this in the Before Header Content hook:
<img src="http://IMAGE-URL-HERE"/>
...instructions, how would I get that image to repeat?
Not sure what you mean? It's a static image so you can just add it as many times as you want.