Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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 like

    function after_head_image_func(){
    	echo "";
    }
    add_action('ava_main_header', 'after_head_image_func');
    #597878

    Hi Guenter!

    Please refer to this post – http://kriesi.at/documentation/enfold/add-subtext-to-logo-replace-logo-with-site-title/

    Cheers!
    Yigit

    #597899

    i 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.
    #597924

    i 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.
    #598357

    hm – 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');	
    #598368

    Hi!


    @Guenni007
    Glad you got it sorted :) and thanks for sharing the tip :)

    Cheers!
    Vinay Kashyap

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Inline svg maybe as logo’ is closed to new replies.