Site logo

Archived topic

Different headers with menu under picture

15 replies · Started by Edwin on November 9, 2016

Viewing posts 1–15 of 16

Hi Tom

I need to build a website with the menu under the header in every page and a slider in the homepage above the menu (The home page with slider is not a problem), but I need in all other pages a different header image with the menu below.

Like this website:

http://www.berryfamilylaw.com.au/

What is the best way to this?

Thanks again for your help.

Edwin

Hi Edwin,

The Page Header add-on allows you to overwrite the logo on individual pages.

If you have a logo set, edit one of your pages and you should see a "Logo" tab in the Page Header meta box.

The only thing is the logo and the header image would need to be merged into one file.

Is there anything your theme can't do :-)
Thanks Tom

You're welcome :)

Hi Tom

I am showing another slider in a different page and all working fine, but menu is showing in the top above the slider.

I tried this and working:

Function.php:

function print_menu_shortcode($atts, $content = null) {
extract(shortcode_atts(array( 'name' => null, 'class' => null ), $atts));
return wp_nav_menu( array( 'menu' => $name, 'menu_class' => $class, 'echo' => false ) );
}

add_shortcode('menu', 'print_menu_shortcode');

Short-code inside the page with the menu styles:

[masterslider id="2"]

Would you able to give me the correct Menu styles?

Thanks

Edwin

Hi Tom

Do i put this in the function.php?

add_action( 'wp','tu_move_nav_inside_page_header' );
function tu_move_nav_inside_page_header()
{
$page_header_content = get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true );
if ( '' !== $page_header_content ) {
remove_action( 'generate_after_header_content', 'generate_add_navigation_float_right', 5 );
add_action( 'generate_after_page_header', 'generate_add_navigation_float_right', 5 );
}
}

What do i change to make it work with that specific page?

http://visualdevelopment.com.au/croxford-partners/index.php/our-services/

Your code would be:

add_action( 'wp','tu_move_nav_inside_page_header' );
function tu_move_nav_inside_page_header()
{
	$page_header_content = get_post_meta( get_the_ID(), '_meta-generate-page-header-content', true );
	if ( '' !== $page_header_content ) {
		remove_action( 'generate_after_header', 'generate_add_navigation_after_header', 5 );
		add_action( 'generate_after_page_header', 'generate_add_navigation_after_header', 5 );
	}
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

It will detect if something is in your Page Header meta box and only apply then.

If you need to apply it to specific pages, you would need to use conditionals: https://codex.wordpress.org/Conditional_Tags

Hi Tom

after adding the code to custom.php file (Generate-simple-php) i am getting this error:

Fatal error: Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of add_action(). in

Hi Tom

Similar error:

The code snippet you are trying to save produced a fatal error on line 2:
Call-time pass-by-reference has been removed; If you would like to pass argument by reference, modify the declaration of add_action().

I'm not getting those errors, and the error is referencing something that doesn't exist in the code.

Make sure you're copying the code from this topic directly - not your email.

Thanks Tom. Working now.
You are the best!!

This archived topic is closed to new replies.