[Resolved] I cannot creat sticky header by GP

Home Forums Support [Resolved] I cannot creat sticky header by GP

Home Forums Support I cannot creat sticky header by GP

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1672385
    thetam

    Hello, I tryna creat a sticky header by using Hook (generate before header), im using GP, but only main nav work
    I already set layout > header > Use Navigation as Header, sticky and turn on “menu sticky”.
    Here is my website: http://thienhabet77.net/
    I want to creat a header like this: thabet.me

    i aslo add this code to funtion.php
    add_action( ‘wp’,’db_sticky_header_navigation’ );
    function db_sticky_header_navigation() {
    remove_action( ‘generate_header’, ‘generate_construct_header’, 10);
    add_action(‘generate_inside_navigation’, ‘generate_construct_header’, 10);
    }

    #1673004
    Elvin
    Staff
    Customer Support

    Hi there,

    You seem to be trying to hitch a few elements on the nav bar’s sticky functionality.

    If that’s the case, I don’t think you need the PHP snippet you’re adding in and the secondary nav bar.

    You can just enable the “Use navigation as header” and create a Block or Hook element to create a secondary nav bar hooked to generate_inside_navigation so it rides in on the sticky script.

    We just need a few custom CSS afterwards to fit your layout.

    A wise man once said:
    "Have you cleared your cache?"

    #1673859
    thetam

    THANKS YOU VERY MUCH ELVIN, IT WORKS PERFECTLY

    #1676572
    Elvin
    Staff
    Customer Support

    Nice one. Glad you got it sorted.

    A wise man once said:
    "Have you cleared your cache?"

    #1685584
    Sean

    Hello, I am trying to figure out how to do this and really don’t understand the terminology. I can’t believe their isn’t an option to make the header sticky like there is for the nav bar. Is this only possible through coding in CSS?
    I want the header image (it’s only 100 pixels tall) and the nav bar below it to stay fixed on each page as people scroll.
    Thanks for any help!

    #1685661
    Leo
    Staff
    Customer Support

    I’ve just replied to your own topic.

    Let’s keep the conversation there.

    Thanks!

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