-
AuthorPosts
-
September 17, 2014 at 3:27 pm #320540
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
September 17, 2014 at 3:36 pm #320550Hi 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,
YigitSeptember 17, 2014 at 4:53 pm #320590thanks 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.
September 17, 2014 at 5:00 pm #320594Hey!
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!
YigitSeptember 17, 2014 at 6:03 pm #320646OK ,
Instead of page ID, can I use MENU ID or MENU NAME?Like below?
https://wordpress.org/support/topic/how-to-get-nav-menu-idHope that helps.
Thanks Ben
September 17, 2014 at 7:00 pm #320673Hey!
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,
YigitSeptember 18, 2014 at 9:57 am #321037thats a shame, as I dont want to change code each time I add a new page.
September 18, 2014 at 1:01 pm #321132 -
AuthorPosts
- The topic ‘Different logo dependent on menu selection?’ is closed to new replies.
