-
AuthorPosts
-
March 3, 2020 at 5:08 pm #1189778
Hello,
I was wondering if you had some input on how to replace the default site logo image by a nanimated json exported from after effects via bodymovin ?
That would be a great way to add an animated logo to my site.
Thanks a lot for your help!Max
- This topic was modified 4 years, 8 months ago by maxgorelkine.
March 4, 2020 at 2:36 pm #1190078Hey maxgorelkine,
Maybe it can be done as the svg logo, here is how
If you need further assistance please let us know.
Best regards,
VictoriaMarch 4, 2020 at 2:45 pm #1190084Hello Victoria, thanks for your reply.
Yes I know about the possibility of using an svg file as a logo, and has been using it regularly :) And there are ways to export an animation as an animated svg, but it’s not very easy to do…
For a couple of years thought, bodymovin has become the best and simplest way to export after effects animations for the web. Unfortunately, it is exported as a json file, not an svg.There is a wordpress plugin allowing to insert a bodymoving json animation as a shortcode.
So maybe the solution would be to replace the logo default image by a shortcode… by I have no idea how :))
Do you know the best way to achieve that ?Thanks a lot!
- This reply was modified 4 years, 8 months ago by maxgorelkine.
March 4, 2020 at 7:58 pm #1190198Hi maxgorelkine,
One way this can be done is by editing the header.php file or actually the /enfold/includes/helper-main-menu.php file to remove the logo and add the necessary code there.
Best regards,
VictoriaMarch 10, 2020 at 3:12 pm #1191870Thank you for your reply. Is there a way to use a shortcode instead of an image for the preloader ?
I’ve copied this code from the functions-enfold.php file to my child theme functions.php/* wrap embeds into a proportion containing div */ if(!function_exists('avia_preload_screen')) { function avia_preload_screen() { $class = avia_get_option('preloader_transitions') != "disabled" ? 'av-transition-enabled' : ""; $label = __('Loading','avia_framework'); $logo = avia_get_option('preloader_logo'); if( is_numeric( $logo ) ) { $logo = wp_get_attachment_image_src( $logo, 'full' ); $logo = is_array( $logo ) ? $logo[0] : ''; } if( $logo ) { $class .= " av-transition-with-logo"; $logo = "<img class='av-preloading-logo' src='{$logo}' alt='{$label}' title='{$label}' />"; } $output = ""; $output .= "<div class='av-siteloader-wrap {$class}'>"; $output .= "<div class='av-siteloader-inner'>"; $output .= "<div class='av-siteloader-cell'>"; $output .= $logo; $output .= "<div class='av-siteloader'><div class='av-siteloader-extra'></div>"; $output .= "</div>"; $output .= "</div>"; $output .= "</div>"; $output .= "</div>"; return $output; } }
I’m trying to replace the image with <?php echo do_shortcode(‘[bodymovin anim_id=”18″ loop=”true” width=”300px” height=”300px” align=”center”]’); ?>
But it doesn’t seem to work…
Can you help ?Thanks a lot!
March 10, 2020 at 10:31 pm #1192037Hi maxgorelkine,
Do you mean you want to show that instead of the preloader? Not the logo in the header?
Best regards,
VictoriaMarch 10, 2020 at 11:07 pm #1192059Yes exactly! To be more precise, I would like to show it instead of the logo used on the preloder overlay.
March 11, 2020 at 3:17 pm #1192311Hi,
I am not sure if this is going to work with your shortcode but could you please try adding following code to bottom of Functions.php file in Appearance > Editor
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { $logo = do_shortcode( '[bodymovin anim_id="18" loop="true" width="300px" height="300px" align="center"]' ); return $logo; }
Best regards,
Yigit- This reply was modified 4 years, 8 months ago by Yigit.
March 11, 2020 at 3:26 pm #1192317Thank you very much, unfortunately it breaks the site… perhaps there is a syntaxe pb ?
March 11, 2020 at 3:31 pm #1192318Hi,
I noticed syntax error and fixed my code. Could you please try updated code?
Best regards,
YigitMarch 11, 2020 at 3:35 pm #1192323Unfortunately, it still breaks the site…
March 12, 2020 at 8:11 pm #1192737Hi maxgorelkine ,
Can you please check the server log for error?
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.