Is there an easier way to do this-
Certain pages are linked to other companies, so on those pages we would like to add their logo to ours at the top. (Had a similar question about the Menu, and what I was told worked beautifully)
Is there a way to add an image next to the logo and/or change the logo per page?
Or can I somehow use a Child theme? (or is that something completely different?) Thank you!
Hey brittanywinter!
You can add following code to Functions.php file in Appearance > Editor to change logo per page
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;
}
and following code to change logo link per page
add_filter('avf_logo_link','av_change_logo_link');
function av_change_logo_link($link)
{
if(is_page(9) )
{
$link = "http://kriesi.at";
}
return $link;
}
You can right click on Chrome or Firefox to inspect elements to find page ID’s http://i.imgur.com/HyPTCRg.jpg
Best regards,
Yigit
Thank you!
So if I had 10 different pages with different logos I would need to put this in 10 times correct?
Hi!
You can add the code as following in that case
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";
}
elseif(is_page(11) )
{
$logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo2.png";
}
elseif(is_page(13) )
{
$logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo3.png";
}
return $logo;
}
Best regards,
Yigit
Thanks! Works Beautifully!
I tried doing the same layout for linking (even no links would be ok) but gave me errors (I really need to learn how to code this way x_X)