Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1137724

    As the topic suggests, I need a different Logo for different websites.
    I tried several forum solutions. Also the most promissing didn’t work:

    add_filter('avf_logo_link','av_change_logo_link');
    function av_change_logo_link($link)
    {
        if(is_page(19) )
    {
        $link = "http://kriesi.at";
    }
        return $link;
    }
    
    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if(is_page(9) )
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    Can you help please?
    best
    Stefan

    #1137929

    Hey Stefan,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1138209

    Thanks Victoria,
    this is just a draft yet.
    thanks and regards
    Stefan

    #1138226

    the last one should work – but as i can read your topic the right way you look also for a solution to change the logo for a whole tree.
    So to speak for page-id-9 f.e and all subpages.

    this here is to define the tree function:

    function is_tree($pid)
    {
    global $post;
    
       $ancestors = get_post_ancestors($post->$pid);
       $root = count($ancestors) - 1;
       $parent = $ancestors[$root];
    
       if(is_page() && (is_page($pid) || $post->post_parent == $pid || in_array($pid, $ancestors))){
         return true;
        }
       else
       {
         return false;
        }
    };

    after that you can change logo for page and subpages.

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo){
    
          if (is_tree(515)) { $logo = "[logo url]";}
      elseif (is_tree(509)) { $logo = "[logo url]";}
      elseif (is_tree(530)) { $logo = "[logo url]";}
    
       return $logo;
    }

    change that: [logo url] the whole expression with your link to your logo url (including brackets)

    #1138227

    but if you like you can do it manually too over an array ( if the amount of pages isn’t so big)
    you can use all conditonal tags you know – the tree solution is above – for categories there ar is_category, in_category or has_category etc. pp)

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo){
        if( is_page(21) ) {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage21.jpg"; 
        }
      
        elseif ( is_page( array( 42, 54, 6 ) ) ) {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage22.jpg"; 
        }
    
        elseif ( is_page() && !is_page(1307) )  {
        	$logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg";  
        }
        return $logo;
    }
    #1138787

    Thanks Guenni :-)
    I tried to get it to run that way. As the 1st solution didn’t work for me the second did!
    Thanks a bunch, Problem solved!

    #1138919

    Hi beenee,

    Glad you got it working for you with Guenni007’s help! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1141367

    Ticket can be closed. txs!

    #1141461

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Different Logo for different websites (subpages)’ is closed to new replies.