[Support request] Background color issues with hook

Home Forums Support Background color issues with hook

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #279607
    David

    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.44
    GP Premium 1.2.94
    #279693
    Leo
    Staff
    Customer Support

    Hi Liz,

    So I assume the changes don’t apply when you click save? What about changes in typography etc?

    Are you using a caching plugin? I’m assuming you are working on a local host?

    #279732
    David

    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.

    I followed

    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.

    #279734
    Leo
    Staff
    Customer 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-theme

    #279750
    David

    I dowloaded the blank from the URL.

    #279940
    Tom
    Lead Developer
    Lead 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.

    #281435
    David

    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.

    #281458
    Tom
    Lead Developer
    Lead 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”?

    #281465
    David

    Yes exactly, the main navigation is set: No Navigation.

    #281505
    David

    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.

    #281624
    Tom
    Lead Developer
    Lead 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.

    #281775
    David

    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.

    #281901
    Tom
    Lead Developer
    Lead Developer

    What if you add the slider into the After Header Content hook?

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