• Despite this added custom css :

    .age-gate #main-header {
    display: none !important;
    }

    The menu is still displayed on age gate; How can I remove it please ?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @lilianstudio – your age-gate class is slightly off. You can do this:

    .age-gate__restricted #main-header {
    display: none !important;
    }

    And it should work.

    Thanks
    Phil

    Thread Starter lilianstudio

    (@lilianstudio)

    Thank you, the top menu indeed is now well hidden on the age request popin now. But the issue is now on my homepage where the top of it is hidden by the menu. I let the css in order you can check. thank you

    Plugin Author Phil

    (@philsbury)

    Hi @lilianstudio,

    Do you mean here?

    If so, once age gate is closed, the styles I gave you stop doing anything so this isn’t an age gate issue – you’d need to pad your container to account for the fixed element (which it looks like you’ve done while I typed this!)

    Thanks
    Phil

    Plugin Author Phil

    (@philsbury)

    Oh, actually – I see the problem… will dig a bit more

    Plugin Author Phil

    (@philsbury)

    Hi again – so there’s a couple more things to do;

    There’s a bit of extra style to account for your separate mobile header:

    .age-gate__restricted #main-header,
    .age-gate__restricted .divi-mobile-menu {
    display: none !important;
    }

    Next, because of how Divi calculates the padding on page load, you need some JS to mimic what they do as there is no height to the header when age gate is showing:

    window.addEventListener('age_gate_hidden', () => document.getElementById('page-container').style.paddingTop = document.getElementById('main-header').offsetHeight + 'px');

    That can go in a JS file if you have one available in your theme.

    You can expand that, and check elements exist if you need to, here’s and example:

    window.addEventListener('age_gate_hidden', () => {
    var container = document.getElementById('page-container');
    var header = document.getElementById('main-header');

    if (container && header) {
    container.style.paddingTop = header.offsetHeight + 'px';
    }
    });

    Thanks
    Phil

    Thread Starter lilianstudio

    (@lilianstudio)

    Thx. It s ll good !

    Just one thing tht remains and promise i won’t bother you anymore.

    How can I add some margin on the top of the yes/no button ?

    thx !

    Thread Starter lilianstudio

    (@lilianstudio)

    Sorry but I notice another indrect bug about the display of the mobile menu. cf link :

    please help

    Plugin Author Phil

    (@philsbury)

    Hi @lilianstudio,

    For the margin, just change to whatever you want:

    :root {
    --ag-button-margin: 10px 0 0 0;
    }

    I don’t see any issues with the header on the front end. If it’s just an issue in the editor, that’ll be something for the theme’s support team.

    Thanks
    Phil

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Menu Header still visible despite css custom’ is closed to new replies.