Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #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!

    #1313807

    Hey 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,
    Ismael

    #1313827

    Hi 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!

    #1314276

    Hi,

    . 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,
    Ismael

    #1315114

    Hi

    Thanks! That’s great. Now how can I make the header size smaller for that contact page?

    #1315988

    Hi,

    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,
    Ismael

    #1316273

    Hi

    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.

    #1316282

    my 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 page

    i 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

    #1316283

    PS – 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_disabled

    see: https://webers-testseite.de/weber/impressum/

    #1316436

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1316976

    It doesn’t seem to be that important anymore!

    #1317100

    Hi 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.

    #1317103

    Oh – 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!

    #1317179

    This way with page array

    if( is_page ( array ( 21, 8675, 13792, 14614 ))){ 
    
    #1317223

    Hi,

    Thanks again for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1317283

    @Guenni007 you are amazing! Thanks!

    #1317380

    You are welcome

    #1317405

    Hi 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,
    Rikard

    #1317578

    We’re all set, thanks again and close away. :)

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Smaller version of header for one page’ is closed to new replies.