Hi
Is there a way to make the main logo change on which menu is selected?
Ive came accross this on forum based on page number
is_page( array( 3120, 3202 ) );
{
echo avia_logo(AVIA_BASE_URL.'images/layout/logo1.png', false, 'strong');
}
else
{
echo avia_logo(AVIA_BASE_URL.'images/layout/logo2.png', false, 'strong');
Any help would be great. Also where would I need to add the code? function-set-avia-frontend.php?
Thanks
Hi bensmithdesign!
Please add following code to Functions.php file in Appearance > Editor
add_filter('avf_logo','av_change_logo');
function av_change_logo($logo)
{
if( is_page( 59 ) )
{
$logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
}
return $logo;
}
It will display different logo on a page with id 59. 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
thanks you thats great, is there a way instead of using page number by menu? As I have different menus and want to show a different logo for one.
Hey!
I am not sure if i understood you clearly, can you elaborate? You can use page ID of the page where you have different menu
Cheers!
Yigit
OK ,
Instead of page ID, can I use MENU ID or MENU NAME?
Like below?
https://wordpress.org/support/topic/how-to-get-nav-menu-id
Hope that helps.
Thanks Ben
Hey!
No you cannot. I understood what you are asking for but i did not understand why you do not want to use page ID’s
Regards,
Yigit
thats a shame, as I dont want to change code each time I add a new page.