Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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

    #320550

    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

    #320590

    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.

    #320594

    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

    #320646

    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

    #320673

    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

    #321037

    thats a shame, as I dont want to change code each time I add a new page.

    #321132

    Hi!

    There is not such WordPress conditional functions unfortunately. It is not a theme limitation. I am marking this thread as resolved for now. Feel free to start a new one if you have any other questions or issues

    Best regards,
    Yigit

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Different logo dependent on menu selection?’ is closed to new replies.