[Support request] Fix background in main menu in some page with elements

Home Forums Support Fix background in main menu in some page with elements

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #1327525
    rafel jesus

    Hi there.
    I have a question, Can I do in the main menu a white background but only in some pages with elements?
    And the second question is Can I do fix the main menu but in all pages except the principal with elements?
    If it’s yes, How can I do?

    Thanks from Balaguer

    Best wishes.
    From Balaguer, near of Barcelona

    #1327704
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if I understand.

    Can you disable the maintenance mode so I can see your set up?

    #1327725
    rafel jesus

    Hi Leo.
    The first part I did with elements.
    I only need to fix the primary menu in some pages exclude the home page.

    The web site is under construction if you need to see something we’ll synchronize for seeing something very quickly.
    Thanks.

    Best wishes.
    From Balaguer, near of Barcelona

    #1327919
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You can adjust the navigation colors using the Header Element, so if you build a Header Element for a set of pages, you can adjust the navigation colors for those pages.

    As for the fixed menu – are you trying to set up the sticky navigation only on some pages? That’s a bit harder. Are you wanting to disable it only on some pages, or enable it only on some pages?

    #1327990
    rafel jesus

    Hi there.

    The colors Header Element for some pages I did and in those pages, I’d want to sticky navigation but only in those pages.
    Now when I do scroll the primary navigation is fixed in all the pages, I’d want to sticky navigation but only in those pages.
    Thanks from Balaguer

    Best wishes.
    From Balaguer, near of Barcelona

    #1328824
    Leo
    Staff
    Customer Support

    So now the issue is turning off the sticky navigation on some pages?

    If so try this PHP snippet:

    add_filter( 'option_generate_menu_plus_settings', function( $settings ) {
        if ( is_page( array( 1, 2, 3 ) )  ) {
            $settings['sticky_menu'] = 'off';
        }
        return $settings;
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/
    https://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

    Make sure to replace 1, 2, 3 with the actual page ids.

    #1328915
    rafel jesus

    Hi Leo.
    I’m going to try and say to you.
    Thanks from Balaguer.

    Best wishes.
    From Balaguer, near of Barcelona

    #1328985
    rafel jesus

    Hi Leo.
    I did with code snippets because I work with Child Theme, but the code didn’t work.

    Thanks from Balaguer

    Best wishes.
    From Balaguer, near of Barcelona

    #1329119
    Leo
    Staff
    Customer Support

    What is the actual code you are using?

    Can you link me to the page that’s not working?

    #1329378
    rafel jesus

    Hi Leo.
    Where can I send access to the backend of this website.?
    Thanks

    Best wishes.
    From Balaguer, near of Barcelona

    #1329381
    Leo
    Staff
    Customer Support

    I don’t need the dashboard access just yet.

    Can you send me the live link to the website?

    You can edit the original topic and use the private URL field.

    Let me know 🙂

    #1329384
    rafel jesus

    The website is under construction and the pages aren’t visible.

    Best wishes.
    From Balaguer, near of Barcelona

    #1329393
    rafel jesus

    Hi
    Say me if you can see.
    https://www.lotapis.cat/cortines/

    Best wishes.
    From Balaguer, near of Barcelona

    #1329586
    David
    Staff
    Customer Support

    That link says under construction.
    You can send the Site Login details using the Account Issue form here:

    https://generatepress.com/contact/

    Please add the URL of this forum topic to the form as well.

    #1330619
    Tom
    Lead Developer
    Lead Developer

    So right now you have the sticky navigation turned off in the Customizer.

    The function Leo provided actually turns it “on” as the theme only looks for a non-false value.

    So the function is working, it’s turning the sticky navigation “on” within the page you specified.

    If you want to disable the sticky navigation only on some pages, you would turn it on in the Customizer, then do this:

    add_filter( 'option_generate_menu_plus_settings', function( $settings ) {
        if ( is_page( array( 1, 2, 3 ) )  ) {
            $settings['sticky_menu'] = 'false';
        }
        return $settings;
    } );
Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.