[Resolved] Different headers with menu under picture

Home Forums Support [Resolved] Different headers with menu under picture

Home Forums Support Different headers with menu under picture

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #243060
    Edwin

    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

    #243090
    Tom
    Lead Developer
    Lead Developer

    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.

    #243098
    Edwin

    Is there anything your theme can’t do ๐Ÿ™‚
    Thanks Tom

    #243105
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

    #246118
    Edwin

    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

    #246142
    Tom
    Lead Developer
    Lead Developer

    Hmm, there might be an easier way.

    This topic might help: https://generatepress.com/forums/topic/move-navigation-to-the-bottom-of-the-header/

    You’ll need to alter a couple of things if your navigation isn’t set to float right – what’s it set to?

    #246144
    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/

    #246161
    Tom
    Lead Developer
    Lead Developer

    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

    #246396
    Edwin

    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

    #246398
    Tom
    Lead Developer
    Lead Developer

    Strange, try adding it using a plugin like this: https://en-ca.wordpress.org/plugins/code-snippets/

    #246403
    Edwin

    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().

    #246404
    Edwin
    #246405
    Tom
    Lead Developer
    Lead Developer

    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.

    #246406
    Tom
    Lead Developer
    Lead Developer
    #246408
    Edwin

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

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.