- This topic has 15 replies, 2 voices, and was last updated 6 years, 4 months ago by
Tom.
-
AuthorPosts
-
November 9, 2016 at 5:38 pm #243060
Visual D
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
November 9, 2016 at 9:21 pm #243090Tom
Lead DeveloperLead DeveloperHi 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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 9, 2016 at 9:41 pm #243098Visual D
Is there anything your theme can’t do ๐
Thanks TomNovember 9, 2016 at 9:51 pm #243105Tom
Lead DeveloperLead DeveloperYou’re welcome ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 20, 2016 at 3:55 pm #246118Visual D
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″]
<ul id=”menu-menu” class=” menu sf-menu”>
[menu name=”menu” class=”main-navigation ul”]Would you able to give me the correct Menu styles?
Thanks
Edwin
November 20, 2016 at 7:58 pm #246142Tom
Lead DeveloperLead DeveloperHmm, 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?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 20, 2016 at 8:25 pm #246144Visual D
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/
November 20, 2016 at 11:20 pm #246161Tom
Lead DeveloperLead DeveloperYour 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
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 21, 2016 at 2:15 pm #246396Visual D
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
November 21, 2016 at 2:21 pm #246398Tom
Lead DeveloperLead DeveloperStrange, try adding it using a plugin like this: https://en-ca.wordpress.org/plugins/code-snippets/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 21, 2016 at 2:36 pm #246403Visual D
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().November 21, 2016 at 2:41 pm #246404Visual D
Hi Tom
Working now, but showing 2 menus now.
http://visualdevelopment.com.au/croxford-partners/index.php/our-services/
November 21, 2016 at 2:41 pm #246405Tom
Lead DeveloperLead DeveloperI’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.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 21, 2016 at 2:42 pm #246406Tom
Lead DeveloperLead DeveloperI just adjusted the code above to fix that: https://generatepress.com/forums/topic/different-headers-with-menu-under-picture/#post-246161
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentNovember 21, 2016 at 2:44 pm #246408Visual D
Thanks Tom. Working now.
You are the best!! -
AuthorPosts
- You must be logged in to reply to this topic.