Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #281035

    Hi!
    I found this:
    https://kriesi.at/support/topic/header-with-different-logos/
    How can I have different logos on “woocommerce”, “woocommerce-page”, “blog” classes? On that pages we don’t have IDs…

    Best regards
    D.

    #281051

    Hey David!

    You can try using this conditional tags for WC pages:
    http://docs.woothemes.com/document/conditional-tags/

    For the blogpage:
    http://codex.wordpress.org/Conditional_Tags#The_Blog_Page

    Best regards,
    Josue

    #281065

    Thanks Josue,
    can you please tell me witch file I have to edit, to change the output logo? This one:
    framework/php/function-set-avia-frontend.php

    How can I change this function quickly?

    if(!function_exists(‘avia_logo’))
    {
    /**
    * return the logo of the theme. if a logo was uploaded and set at the backend options panel display it
    * otherwise display the logo file linked in the css file for the .bg-logo class
    * @return string the logo + url
    */
    function avia_logo($use_image = “”, $sub = “”, $headline_type = “h1”, $dimension = “”)
    {
    $use_image = apply_filters(‘avf_logo’, $use_image);
    $headline_type = apply_filters(‘avf_logo_headline’, $headline_type);
    $sub = apply_filters(‘avf_logo_subtext’, $sub);
    $alt = apply_filters(‘avf_logo_alt’, get_bloginfo(‘name’));
    $link = apply_filters(‘avf_logo_link’, home_url(‘/’));

    if($sub) $sub = “<span class=’subtext’>$sub</span>”;
    if($dimension === true) $dimension = “height=’100′ width=’300′”; //basically just for better page speed ranking :P

    if($logo = avia_get_option(‘logo’))
    {
    $logo = apply_filters(‘avf_logo’, $logo);
    $logo = “{$alt}“;
    $logo = “<$headline_type class=’logo’>“.$logo.”$sub</$headline_type>”;
    }
    else
    {
    $logo = get_bloginfo(‘name’);
    if($use_image) $logo = “{$alt}“;
    $logo = “<$headline_type class=’logo bg-logo’>“.$logo.”$sub</$headline_type>”;
    }

    $logo = apply_filters(‘avf_logo_final_output’, $logo, $use_image, $headline_type, $sub, $alt, $link);

    return $logo;
    }
    }

    #281069

    Don’t edit that, try adding this at the very end of your theme functions.php file:

    function av_change_logo($logo, $use_image, $headline_type, $sub, $alt, $link){
    
    	if(is_front_page()){
    		$logo_url = "_LOGO_URL_";
    	}
    
    	if(is_woocommerce()){
    		$logo_url = "_LOGO_URL_";
    	}
    	
    	if($dimension === true) $dimension = "height='100' width='300'"; 
    	if(empty($logo_url)) $logo_url = avia_get_option('logo');
    
    	$logo = "<img {$dimension} src='{$logo_url}' alt='{$alt}' />";
    	$logo = "<$headline_type class='logo bg-logo'><a href='".$link."'>".$logo."$sub</a></$headline_type>";
    	
    	return $logo;
    }

    Change as needed.

    Cheers!
    Josue

    #281085

    Hi Jouse,
    I inserted the code in functions.php of my child theme! Under the Theme Options I have to remove the logo and leave it empty? For now doesn’t work for me.

    D.

    #281087

    Sorry, forgot this line:

    add_filter('avf_logo_final_output', 'av_change_logo', 100, 6);
    

    Put it right below the other code.

    Best regards,
    Josue

    #281107

    Hey Josue!
    Thank you very much! Now it works perfectly!!

    Cheers
    D.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Header with different logos’ is closed to new replies.