-
AuthorPosts
-
March 14, 2016 at 5:13 pm #597856
on pages/post there is the possibility to place an svg not as an img tag by setting a code element.
The great advantage is that it is possible to get influence on the svg styles inside the svg. For Example the fill color.
you can see it on private content – on background images (non inline svgs) this is not possible (if yes please tell me)Is there a possibility to get an inline svg instead of img as logo?
Maybe set logo to display none and put in dynamically code in the header.php or via functions.php of child-theme likefunction after_head_image_func(){ echo ""; } add_action('ava_main_header', 'after_head_image_func');
March 14, 2016 at 5:26 pm #597878Hi Guenter!
Please refer to this post – http://kriesi.at/documentation/enfold/add-subtext-to-logo-replace-logo-with-site-title/
Cheers!
YigitMarch 14, 2016 at 5:51 pm #597899i thought i can take the whole content of the svg and rename it f.e: inline-logo.svg.php
i can place this in root of child-theme and try to “get” it as inline.svg via
get_template_part('images/inline', 'logo.svg')
__________________________________________
on your code – i use it often in this form :
add_filter('avf_logo_subtext', 'kriesi_logo_addition'); function kriesi_logo_addition($sub) { $sub .= "<span class='logo-title'>"; $sub .= get_bloginfo( 'name', 'display' ); $sub .= "</span>"; $sub .= "<span class='logo-title logo-subtitle'>"; $sub .= get_bloginfo( 'description', 'display' ); $sub .= "</span>"; return $sub; }
so i can use name and description from WP
but how do i set in the svg code as $sub ?
- This reply was modified 8 years, 8 months ago by Guenni007.
March 14, 2016 at 6:41 pm #597924i see that this is defined in the “function-set-avia-frontend.php”
isn’t it possible to use perhaps the “$use_image” to insert a inline svg ? instead of the $sub ?
maybe something like this:
add_filter('avf_logo', 'kriesi_logo_addition'); function kriesi_logo_addition($use_image) { $use_image .= ??? return $use_image; }
if i use in “function-set-avia-frontend.php” :
if($logo = avia_get_option('logo')) { $logo = apply_filters('avf_logo', $logo); if(is_numeric($logo)){ $logo = wp_get_attachment_image_src($logo, 'full'); $logo = $logo[0]; } $logo = file_get_contents($logo); $logo = "<$headline_type class='logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>"; }
but i don’t want to think at every time i update the theme on that change.
- This reply was modified 8 years, 8 months ago by Guenni007.
March 15, 2016 at 1:35 pm #598357hm – can be closed i got it in this way (two logos option – and logo img on display none)
it seems to be important to have the absolute path to the uploaded svg images (code comes to child-themes function.php)function first_logo($logo) { $logo .= '<strong class="logo first-logo"><a href="/bonnzeit">' ; $logo .= file_get_contents("absolute-url1.svg"); $logo .= '</a></strong>'; return $logo; } add_filter('avf_logo_final_output', 'first_logo'); function second_logo($logo) { $logo .= '<strong class="logo second-logo bg-logo"><a href="/bonnzeit">' ; $logo .= file_get_contents("absolute-url2.svg"); $logo .= '</a></strong>'; return $logo; } add_filter('avf_logo_final_output', 'second_logo');
March 15, 2016 at 1:47 pm #598368 -
AuthorPosts
- The topic ‘Inline svg maybe as logo’ is closed to new replies.