- This topic has 12 replies, 3 voices, and was last updated 4 years ago by Tom.
February 16, 2017 at 4:18 am #279607David
Hello, I am designing a template and I have a problem.
I have had to change the position of the menus to put the secondary menu first, then a DIV for a slider and followed the main menu.
I have disabled the menus and then added these lines in the GPHook “After Header” to be able to have the desired menu settings:
<?php if ( function_exists( 'generate_secondary_navigation_position' ) ) generate_secondary_navigation_position(); ?> <div id="main-slider" class="main-slider"></div> <?php if ( function_exists( 'generate_navigation_position' ) ) generate_navigation_position(); ?>
But this happens:
As you can see, the main menu correctly acquires the color background settings in the customization screen but does not work well outside the customization screen.?¿
However, the secondary menu, presents no problems and loads correctly on both.
I have a child theme. No more modifications.GeneratePress 1.3.44GP Premium 1.2.94February 16, 2017 at 7:57 am #279693LeoStaffCustomer SupportFebruary 16, 2017 at 8:43 am #279732David
Yes, I’m on localhost but I’ve recreated the problem online with a fresh install and it’s exactly the same.
I only have the plugins: WooCommerce and GP Premium
It looks like it has not loaded an stylesheet from some php function.
1º Activate GP Plugins: GP Hooks, Secondary nav
2º Create Main menu and secondary menu in WP.
3º In “WP -> Apperance -> Customize -> Layout” Primary and secondary = No navigation
4º In GP Hooks: I put the code of my first post.
And the main menu style sheet disappears when I load the page normally.February 16, 2017 at 8:48 am #279734LeoStaffCustomer Support
hmm did you started your own child theme or you downloaded a blank one from here? https://docs.generatepress.com/article/using-child-theme/#installing-a-child-themeFebruary 16, 2017 at 8:57 am #279750David
I dowloaded the blank from the URL.February 16, 2017 at 2:36 pm #279940TomLead DeveloperLead Developer
Any chance you can link me to the live site with the problem?
Also, why not use the built in navigation location options to place the secondary nav above the header, and the primary nav below the header? Then hook the slider into the header.February 20, 2017 at 10:15 am #281435David
I can show you the basic structure I need to create the whole shop, and the issue in the main menu:
If you need, I can send you an email with the user / pass to check for yourself.February 20, 2017 at 10:33 am #281458TomLead DeveloperLead Developer
GP will only write the CSS for the navigation if it’s set to display. I’m assuming you have the Customizer option for the navigation set to “No Navigation”?February 20, 2017 at 10:54 am #281465David
Yes exactly, the main navigation is set: No Navigation.February 20, 2017 at 12:26 pm #281505David
I fixed the problem.
I deactivated GPHooks, and then activated again primary menu and I’ve put the slider in header.php (in the child theme):
<?php do_action( 'generate_before_header' ); ?> <?php do_action( 'generate_header' ); ?> <div id="main-slider" class="main-slider"></div> <?php do_action( 'generate_after_header' ); ?>
So, I think this is the fast way to fix this xD.February 20, 2017 at 4:33 pm #281624TomLead DeveloperLead Developer
Why not just add your slider into the After Header hook in GP Hooks? That way you don’t need to overwrite the entire header file.February 21, 2017 at 3:11 am #281775David
Yes, is the first thing I did, but, if you recheck my online website, you will see that the primary menu is on top of the slider if I use the “After header” hook. Looks like the primary menu has priority always in the hook “After header”.
I was trying to change with css but I cant.February 21, 2017 at 7:35 am #281901
- You must be logged in to reply to this topic.