-
AuthorPosts
-
July 28, 2021 at 9:16 pm #1313099
Hi team Enfold
On a client’s website, we have a shrinking header. Now the client would like the shrunk version of the header for the contact page only, so it’s not as dominant as on the other pages. Simply put – how can I set the height of the menu bar for one page?
The page is: https://warredal.be/contactformulier-warredal/
Thanks a lot!
August 2, 2021 at 5:18 am #1313807Hey KatrienW,
Thank you for the inquiry.
Try to disable the shrinking header option completely, then use this filter in the functions.php file to enable it back on the contact page.
function avf_header_setting_filter_mod($header_settings) { if ( is_page(21) ) { $header_settings['header_sticky'] = 'disabled'; $header_settings['header_shrinking'] = "disabled"; $header_settings['header_size'] = "slim"; } return $header_settings; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1);
Let us know how it goes.
Best regards,
IsmaelAugust 2, 2021 at 7:05 am #1313827Hi Ismael
Thanks for your response. We want to keep the shrinking header on all the pages though, except for the contact page. There we only want the smaller version of the header from the start. Will this code achieve that?
Thanks!
August 4, 2021 at 6:49 am #1314276Hi,
. Now the client would like the shrunk version of the header for the contact page only,
That is what you said on your initial post. We adjusted the code a bit. It should now disable the shrinking header on the contact page.
Best regards,
IsmaelAugust 8, 2021 at 1:18 pm #1315114Hi
Thanks! That’s great. Now how can I make the header size smaller for that contact page?
August 10, 2021 at 8:36 am #1315988Hi,
We added the header_size parameter in the filter above and set it to slim. This should decrease the size of the header in your contact page. Please replace the previous filter.
Best regards,
IsmaelAugust 11, 2021 at 2:24 pm #1316273Hi
Hm I guess I’m doing something wrong here, I replaced the filter but the header remains too big. Can I replace ‘slim’ with a pixel value in some way? I tried replacing it with 45px (the size we need it to be), but to no avail.
August 11, 2021 at 3:31 pm #1316282my observation is that it would be very hard to determine for one page a shrinking if you do not have shrinking header on enfold options page.
Guess it has something to do with embedding the scripts needed and to get rid of html class – set from beginning. Maybe Guenter knows a way to get this way around.
But as i see – there is a shrinking header – that is possible to get rid of for one pagei would use the filter a bit different. – Replace that code above ( save a copy of that snippet ) :
function avf_header_setting_filter_mod($header) { if ( is_page(21) ) { $header['header_layout'] = 'logo_left main_nav_header menu_right'; $header['header_sticky'] = 'header_sticky'; $header['header_shrinking'] = 'disabled'; $header['header_stretch'] = 'disabled'; $header['header_size'] = 'custom'; // slim, large or custom $header['header_custom_size'] = '45' ; // if custom size : integer value in px // on default we do add here classes by .= but in this case $header['header_class'] = " av_header_top av_logo_left av_main_nav_header av_menu_right av_custom av_header_sticky av_header_shrinking_disabled av_header_stretch_disabled "; } return $header; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 10, 1);
PS : on dropdown custom pixel value option less than 45px are not possible – on that snippet above you can even choose less than 45px
August 11, 2021 at 3:53 pm #1316283PS – if you do not like to have it sticky: change it to disabled
– but do not forget to set the class too: av_header_sticky_disabledAugust 12, 2021 at 1:29 pm #1316436August 16, 2021 at 4:12 pm #1316976It doesn’t seem to be that important anymore!
August 17, 2021 at 7:16 am #1317100Hi Guenni and Rikard
I just got back from my annual vacation, so that’s why it took me a while to reply. Thanks for the offered solutions! They helped a lot and we’ll be able to work with that.
August 17, 2021 at 7:35 am #1317103Oh – one last question: How do I add multiple page ids to the code? The contact page exists in four languages. :) For instance – the EN page is ID 8675. Thanks!
August 17, 2021 at 4:15 pm #1317179This way with page array
if( is_page ( array ( 21, 8675, 13792, 14614 ))){
August 18, 2021 at 3:52 am #1317223August 18, 2021 at 7:30 am #1317283@Guenni007 you are amazing! Thanks!
August 18, 2021 at 9:03 pm #1317380You are welcome
August 19, 2021 at 4:54 am #1317405Hi KatrienW,
Great, I’m glad that @guenni007 could help you out. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardAugust 20, 2021 at 8:15 am #1317578We’re all set, thanks again and close away. :)
-
AuthorPosts
- The topic ‘Smaller version of header for one page’ is closed to new replies.