-
AuthorPosts
-
November 16, 2021 at 12:15 pm #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');November 17, 2021 at 1:30 pm #1329346Hey 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,
YigitNovember 17, 2021 at 2:46 pm #1329352Thank 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 ;)
November 17, 2021 at 5:14 pm #1329366 -
AuthorPosts
- The topic ‘Replace alternate Logo on some pages’ is closed to new replies.
