-
AuthorPosts
-
January 16, 2018 at 6:28 pm #898098
I’ve read the post below about having different logos for different pages.
https://kriesi.at/support/topic/different-logo-on-different-pages/
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 6 years, 11 months ago by waveseven.
January 18, 2018 at 10:30 pm #899325Hey 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,
BasilisJanuary 18, 2018 at 11:47 pm #899350well – he is talking about the alternate logo on subtext ( logo for transparent mode)
header_replacement_logohe wants a different alternate logo on some pages
January 19, 2018 at 11:29 am #899592Thanks 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
ColinJanuary 19, 2018 at 2:07 pm #899699but 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 6 years, 11 months ago by Guenni007.
January 19, 2018 at 2:14 pm #899702The filter ‘avf_header_setting_filter’ maybe helpfull.
January 19, 2018 at 2:30 pm #899707It 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.January 23, 2018 at 4:57 am #901137Hi,
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,
IsmaelJanuary 24, 2018 at 3:50 pm #902200Hi 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 6 years, 11 months ago by waveseven.
January 25, 2018 at 6:12 am #902582Hi,
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,
IsmaelFebruary 5, 2018 at 2:36 pm #908005The 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
ColinFebruary 6, 2018 at 1:53 pm #908580It’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
February 7, 2018 at 12:34 pm #909071Hi,
Great! Glad that you figured it out. Let us know if you need anything else. :)
Best regards,
IsmaelFebruary 14, 2018 at 3:23 pm #912306if these are all portfolio items you got on your page you can use this if clause:
if(is_singular('portfolio')) { …
February 15, 2018 at 5:24 am #912611 -
AuthorPosts
- You must be logged in to reply to this topic.