- This topic has 7 replies, 2 voices, and was last updated 4 years, 3 months ago by
Leo.
-
AuthorPosts
-
August 14, 2019 at 8:41 pm #984508
Fox
Hi!
I am trying to figure out how to use a full screen menu and nav on the main page (and several others), while keeping the contained one on archives and others.
I was thinking of something along the lines of this topic, but as far as I understand the menu plus filter does not toggle the width settings, it’s one of the more basic features?
Is there some kind of obvious solution that I’m missing? Or if not, could you please point me in the direction of the less obvious one?
August 15, 2019 at 8:47 am #984946Leo
StaffCustomer SupportHi there,
I believe this filter should help:
https://docs.generatepress.com/article/option_generate_settings/There is an example at the bottom of the page.
Have a look and let me know if you need help with the code π
August 15, 2019 at 9:20 am #984983Fox
Thank you so much, Leo, this is just what I was looking for! Your support here on GP is exemplary. Most questions I find answers to through searching the forums and docs, and when I can’t, you answer really promptly. Thank you.
August 15, 2019 at 9:25 am #984992Leo
StaffCustomer SupportThanks for the kind words! Always good to hear that π
August 15, 2019 at 10:55 am #985062Fox
I have one more seemingly related question if that’s ok.
When I add the filters to make header and nav full width that seems to unset a lot of the customizations I previously entered through the customizer.
I am adding the code to my child theme’s functions.php, the snippet is the following:
add_filter( 'option_generate_settings','lh_single_posts_settings' ); function lh_single_posts_settings( $options ) { if ( is_front_page() ) { $options['header_layout_setting'] = 'fluid-header'; $options['nav_layout_setting'] = 'fluid-nav'; return $options; } }
Is there something I’m doing incorrectly that’s causing the issue? Or do I need to choose whether I’m using the customizer or doing things manually, but not both?
I tried using an else to specify that the nav and header must be contained in all other cases, but that helped. But either way on all pages except for the main one I now also see the site title and the tagline (and the hide option is now unchecked in the customizer though it was previously checked), and adding code to hide them does not seem to help. And the layout has gone back to sith sidebar for some reason.
Sorry if this is written in a confusing way, I am struggling with explaining it clearly.August 15, 2019 at 2:00 pm #985171Leo
StaffCustomer SupportCan you try this?
add_filter( 'option_generate_settings','lh_front_page_settings' ); function lh_front_page_settings( $options ) { if ( is_front_page() ) { $options['header_layout_setting'] = 'fluid-header'; $options['nav_layout_setting'] = 'fluid-nav'; } return $options; }
August 15, 2019 at 2:24 pm #985190Fox
Thanks, that seems to work. The confusing part is it seems identical to what I posted (except for the function name, but that shouldn’t really matter).
The only thing now is when I open the customizer it stops working, but as soon as I close the customizer it works again. But the title and tagline have stopped appearing, and all the other customizer settings reset themselves any more. So I think I’m good, thanks. =)
August 15, 2019 at 2:33 pm #985197Leo
StaffCustomer SupportThe two functions aren’t identical. You had
return $options;
inside the if statement. -
AuthorPosts
- You must be logged in to reply to this topic.