Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1437292
    #1437396

    this sub logo is called header_replacement_logo and could be changed via avf_header_setting_filter:
    But: there must be something to replace – means : a transparency logo had to be defined on enfold options – then it could be replaced by a different logo.
    on handling svg files just use the ID of that Logo ( look to your media library in list mode). Or look to url window in grid mode
    on inserting/replacing png, jpg or gif use the url to replace the standard logo and not the ID

    function av_change_alt_logo_img($header){
       if (is_page('about')) {
            $header['header_replacement_logo'] = 44238;
        }
        return $header; 
    }
    add_filter('avf_header_setting_filter','av_change_alt_logo_img');

    PS: if the named page does not work use the ID of that page (without quotes)

    next : if you do not want to declare a transparency options logo on enfold options- then only activate the transparency logo for that page before adding the logo:

    function av_change_alt_logo_img($header){
        if(is_page('about')) {
    	$header['header_class'] .= ' av_alternate_logo_active';
            $header['header_replacement_logo'] = 44238;
        }
        return $header; 
    }
    add_filter('avf_header_setting_filter','av_change_alt_logo_img');

    _______________

    PPS: this is a good way to replace the logo (standard logo) with an svg file :

    function av_change_logo($logo){
      if(is_page(123)) {
        $logo = 456;  // ID of the svg Logo
      }
      return $logo;
    }
    add_filter('avf_logo', 'av_change_logo');
    #1437437

    Just for info: I always recommend reworking the code of Illustrator-generated svg. Illustrator assigns a standard class with a counting index (st0, st1, st2 etc.). Unfortunately, if there are several inline svg on a page, the last svg on the page determines the properties of the class. Just css.
    Either you edit the svg in a good text editor, or you define your own graphic styles in Illustrator for the fillings of the graphic elements. The graphic styles are then transferred to the svg code as a class.

    #1437438

    Hi @Guenni007

    I really appreciate your detailed response. I however tried all of your solutions with no luck:

    function av_change_logo($logo){
        if(is_page(3597)) {
            $logo = 3951;  // ID of the svg Logo
        }
        return $logo;
        }
    add_filter('avf_logo', 'av_change_logo');
    
    function av_change_alt_logo_img($header){
        if (is_page(3597)) {
                $header['header_class'] .= ' av_header--about';
                $header['header_replacement_logo'] = 3951;
            }
        return $header; 
        }
    add_filter('avf_header_setting_filter','av_change_alt_logo_img');

    Still only the first SVG in the “logo avia-svg-logo” was updated, not the logo in “subtext avia-svg-logo-sub”, although not ideal, I have since achieved what I was after using the header_class and CSS:

    .av_header--about {
        .avia-svg-logo-sub {
            opacity: 0;
        }
        svg {
            opacity: 1 !important;
        }
    
        &:not(.av_header_transparency) {
            svg {
                path {
                    fill: #4e4e4e;
                }
            }
        }
    }

    Thanks all the same
    Sean

    #1437439

    Scratch that, I found some other header styles I have which mess with the opacity, so I would imagine my issue relates to that and your code probably works fine.

    Thanks again

    #1437441

    try:
    (but as mentioned above – if you have defined a standard transparency logo on enfold options – you do not need to add that header_class)

    function av_change_alt_logo_img($header){
        if(is_page(1313)) {
    	$header['header_class'] .= ' av_alternate_logo_active';  
            $header['header_replacement_logo'] = 3951;
        }
        return $header; 
    }
    add_filter('avf_header_setting_filter','av_change_alt_logo_img');

    the header class to activate the transparency logo is set by enfold to: av_alternate_logo_active
    the page-id of your about page is : 1313 isn’t it ?
    the logo ID – can not proove it from dev tools.

    #1437442

    by the way – if your logo svg is well designed – you can change on inline svg fillings with quick css.
    because you do not have a shrinking header – you can use for that the header class: av_header_transparency

    f.e.:

    .av_header_transparency .logo .st0 {
       fill: #4e4e4e
    }

    and here you can see the benefit of reworking the svg code – that class ( or there might be other path on that page) are allways the same for standard Illustrator setting.
    _______________

    btw: if you got a shrinking header you can use the class on html in combination with the class header-scrolled.

    .html_header_transparency #header:not(.header-scrolled) .logo .st0 {
      fill: #4e4e4e
    }
    #1437443

    so here is my version of your logo:
    https://webers-testseite.de/motive-agency.svg

    on looking to the svg with dev tools ( or download it and see in a good text editor) you see that i renamed the standard classes st to ma – and even the gradient is build via class – so changing it from outwards css (quick css) is easy even for the gradient stop-colors.

    #1439690

    sorry one error there is an extra attr for Logo ID: header_replacement_logo_id

    so snippet has to be :

    function av_change_alt_logo_img($header){
        if(is_page(1313)) {
    	$header['header_class'] .= ' av_alternate_logo_active';  
            $header['header_replacement_logo_id'] = 3951;
        }
        return $header; 
    }
    add_filter('avf_header_setting_filter','av_change_alt_logo_img');
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.