Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1329199

    the normal logo substitution on some pages with filter: avf_logo is still working – but replacing the alternate logo
    via filter : avf_header_setting_filter does not work anymore – even with png/jpg files
    ( at least if you have set an svg by default for the rest of the pages. )
    f.e.

    function replace_transparent_logo_on_some_pages($header){
        if( is_front_page( ) ){
            $header['header_replacement_logo'] = "https://url-to-the-new-logo";
        }
        return $header; 
    }
    add_filter('avf_header_setting_filter','replace_transparent_logo_on_some_pages');

    Edit : yes -tested it if the enfold setting for Transparency Logo is empty or an jpg/png it works. – But if Standard is set to svg and want to replace that with a different svg – it doesn’t
    and even if i set priority and accepted_args – it has no effect.
    add_filter('avf_header_setting_filter','replace_transparent_logo_on_some_pages, 10 , 1');

    #1329346

    Hey Guenter,

    I tested using following code and it worked for me

    function replace_transparent_logo_on_some_pages($sub){
        if( is_front_page( ) ){
            $sub = 'content of the SVG file here';
        }
        return $sub;
    }
    add_filter('avf_logo_subtext','replace_transparent_logo_on_some_pages');

    Though it does not work with URL, only with SVG content

    Best regards,
    Yigit

    #1329352

    Thank you – that works – looks horrible in child-theme functions.php – but it is faster than:

    function replace_transparent_logo_on_some_pages(){
    if(is_front_page()){
    ?>
    <script>
    (function($){  
        $.get('URL_of_that_SVG', function(svg){
          $( ".avia-svg-logo-sub" ).html( svg );
        }, 'text');
    })(jQuery);
    </script>
    <?php
    }
    }
    add_action('wp_footer', 'replace_transparent_logo_on_some_pages');

    i try to get a combination of both ;)

    #1329366

    Hi,

    You are welcome! Let us know if you have any other questions and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Replace alternate Logo on some pages’ is closed to new replies.