Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #898098

    I’ve read the post below about having different logos for different pages.

    https://kriesi.at/support/topic/ (Purchase code hidden if logged out) /

    It seems to work OK but not if you are using transparent headers. How would I get the code to work with the transparent headers?

    Many Thanks
    Regards
    Colin

    • This topic was modified 1 year, 7 months ago by  waveseven.
    #899325

    Hey waveseven,

    I thought we have replied here ( maybe a double post ) but as I said, the code should work on any of the header styles, wouldnt be something that is not resonable to not to work like that.

    Best regards,
    Basilis

    #899350

    well – he is talking about the alternate logo on subtext ( logo for transparent mode)
    header_replacement_logo

    he wants a different alternate logo on some pages

    #899592

    Thanks for your replies,

    I have managed to work it out….

    If a logo is already set in Theme Options>Header>Transparency Options it seems to override any code you add to functions.php in your child theme. If you remove the logo set in “Transparancy logo” and use the following code it all works as expected:

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if(is_page(array(3944,3948,3514,3532,3654.3899,3435,3603,3447,3506,3484) ))
        {
        $logo = "https://domainname.co.uk/wp-content/uploads/company-logo-1.png";
        }
        if(is_page(array(3686,3694,3696,3705,3707,3812,3891,3703,3699,3882,3819) ))
        {
        $logo = "https://domainname.co.uk/wp-content/uploads/company-logo-2.png";
        }
        return $logo;
    }

    Many Thanks
    Regards
    Colin

    #899699

    but it was an interesting question anyway .
    it must be possible to set up a pair of logos for a specific page.
    One for non transparent mode and one for transparency case.

    ?
    maybe via $addition ?

    • This reply was modified 1 year, 7 months ago by  Guenni007.
    #899702

    The filter ‘avf_header_setting_filter’ maybe helpfull.

    #899707

    It would be interesting to know of any solutions via $addition or the filter ‘avf_header_setting_filter’
    I am not really a coder and found the code that I used above in a different post.

    #901137

    Hi,

    Please use the following filter.

    add_filter('avf_header_setting_filter','avf_header_setting_filter_mod');
    function avf_header_setting_filter_mod($header)
    {
        if( is_page('PAGE ID/NAME HERE') ){
            $header['header_replacement_logo'] = "IMAGE HERE";
        }
        return $header; 
    }

    Adjust the values as needed.

    Best regards,
    Ismael

    #902200

    Hi Ismael

    Thanks for the info. This is very similar to the code I used to get it to work OK, which I posted above. Can the header filter be used for multiple pages?

    Many Thanks
    Regards
    Colin

    • This reply was modified 1 year, 7 months ago by  waveseven.
    #902582

    Hi,

    Yes, replace the if statement with an elseif statement.

    add_filter('avf_header_setting_filter','avf_header_setting_filter_mod');
    function avf_header_setting_filter_mod($header)
    {
        if( is_page('PAGE ID/NAME HERE') ){
            $header['header_replacement_logo'] = "IMAGE HERE";
    	}
    	elseif (is_page('PAGE ID/NAME HERE')) {
    		$header['header_replacement_logo'] = "IMAGE HERE";
    	} 
    	elseif (is_page('PAGE ID/NAME HERE')) {
    		$header['header_replacement_logo'] = "IMAGE HERE";
    	}
    	else {
    		$header['header_replacement_logo'] = "IMAGE HERE";
    	}
        return $header; 
    }

    Best regards,
    Ismael

    #908005

    The code above doesn’t seem to work for portfolio-item pages.

    Is there code that I can use for changing the logo on portfolio-item pages?

    Many Thanks
    Regards
    Colin

    #908580

    It’s OK I have worked it out. If I add the following it works.

    if(is_single(array(4343, 4337, 4336, 4330, 4329, 4326, 4319, 4315, 4310, 4307, 4303, 4296, 4294, 4289, 4285, 4282, 4280, 4277, 4276, 44, 3857, 3617, 3919, 3925) ))
        {
        $logo = "https://domainname.co.uk/wp-content/uploads/company-logo-2.png";
        }

    You learn something every day !

    Colin

    #909071

    Hi,

    Great! Glad that you figured it out. Let us know if you need anything else. :)

    Best regards,
    Ismael

    #912306

    if these are all portfolio items you got on your page you can use this if clause:

    if(is_singular('portfolio')) { …

    #912611

    Hi,

    Thanks for sharing @guenni007 :-)

    Best regards,
    Rikard

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.