-
AuthorPosts
-
May 13, 2015 at 1:48 am #443474
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!May 13, 2015 at 5:45 pm #443883Hey 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,
YigitMay 13, 2015 at 6:50 pm #443948Thank you!
So if I had 10 different pages with different logos I would need to put this in 10 times correct?
May 13, 2015 at 7:01 pm #443957Hi!
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,
YigitMay 13, 2015 at 10:15 pm #444015Thanks! 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) -
AuthorPosts
- The topic ‘Change Logo Per Page?’ is closed to new replies.
