[Resolved] Sticky Primary Navigation for specific pages?

Home Forums Support [Resolved] Sticky Primary Navigation for specific pages?

Home Forums Support Sticky Primary Navigation for specific pages?

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #588910
    Francisco

    Ok. This CSS seems to work!!!
    Anyway, could you provide me with the code to disable the sticky navigation? I will be able to try both routes and then I will decide. Thank you so much!

    #588911
    Francisco

    Ok. This CSS seems to work!!!
    Anyway, Leo, could you provide me with the code to disable the sticky navigation? I will be able to try both routes and then I will decide. Thank you so much!

    #588915
    Leo
    Staff
    Customer Support

    We can use this PHP snippet:

    add_filter( 'option_generate_menu_plus_settings','lh_turn_off_sticky' );
    function lh_turn_off_sticky( $options ) {
        if ( is_page( 554 ) ) {
            $options['sticky_menu'] = 'false';
        }
        
        return $options;
    }

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    More info here: https://docs.generatepress.com/article/option_generate_menu_plus_settings/

    #588919
    Francisco

    I have add your PHP snippet using Code Snippets plugin, as it is suggested in documentation, but it does not work… (I have remove the previous CSS to try it).

    #588963
    Leo
    Staff
    Customer Support

    Sorry – edited the code above.

    #589023
    Francisco

    Yes. Now it works perfect! Thank you very much!
    Only one more question: if I would like to do the same in other page, should I copy-paste changing the page-id or could I add more page-id to that function?
    Thank you again. Your customer support service is amazing.

    #589025
    Leo
    Staff
    Customer Support

    This should help: https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    Glad we’ve been helpful 🙂

Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.