Viewing 19 posts - 1 through 19 (of 19 total)
  • Author
    Posts
  • #830500

    Hi Team,

    https://kriesi.at/support/topic/different-header-logo-on-some-pages-only/#post-409856

    Refer to the link aboved, I wonder what should I add to function.php
    Changing the page’s LOGO, and same to all the others after the slug of that page?

    add_filter(‘avf_logo’,’av_change_logo’);
    function av_change_logo($logo)
    {
    if(is_tax(‘ CANADA ‘) )
    {
    $logo = “Logo.png”;
    }
    return $logo;
    }

    So that every pages got the same LOGO base on slugs like…
    CANADA/page1
    CANADA/page2
    CANADA/page3

    Regards

    #831711

    Hey longlife0428,

    Please, may you provide to us your website link and the WP and FTP credentials?

    Best regards,
    John Torvik

    #831954

    Hey John,

    Thanks for your feedback.

    Check the credentials below

    Regards

    #833161

    Hi Team,

    Any though of that?

    Please let me know if that is not possible.

    Regards

    #833908

    Hi,

    Would you like to change the logo on Canada page and its child pages? If so, please use the code as following

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if(is_page(59) || $post->post_parent == '59')
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    Please replace 59 with Canada pages ID

    Best regards,
    Yigit

    #834174

    Hi @Yigit,

    I have added the code into the functions.php, but there is nothing changed.

    Regards

    #834254

    Hi,

    Can you post a link to your “Canada” page and to its child pages?

    Best regards,
    Yigit

    #834299

    Hi Yigit,

    Refer this link:

    CANADA PAGE

    I am trying to make all the links on this pages same logo.

    Regards

    #834320

    Hi,

    Can you please try using the code as following

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        global $post;
        if(is_page(17806) || $post->post_parent == '17806')
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    Best regards,
    Yigit

    #834323

    Hi Yigit,

    I did add the code to the file. It just change the logo of that page (17806) only.

    I notice that the code you gave me was for post

    $post->post_parent == ‘17806’

    Do you think is it because of this?

    Regards

    #836213

    Hi,

    Yes, the code will change the logo of the page with the id 17806. What do you mean by “and same to all the others after the slug of that page?”?

    Best regards,
    Ismael

    #836235

    Hi Ismael,

    Just like Yigit said, I would like to change the logo on 17806 page and all its child pages.

    Than they can all have the same logo with.

    if(is_page(17806) || $post->post_parent == ‘17806’)

    I think this is gonna be the answer, however it just changed the 17806 page only.

    Regards

    • This reply was modified 7 years, 3 months ago by Dave.
    #836818

    Hi,

    The global variable “$post” has been left out. We included it in the filter. Please try it again.

    Best regards,
    Ismael

    #836925

    Hi Ismael,

    Nothing changed~

    In case of taking too long, I will put them here together.

    TOPIC: How would I change the logo on 17806 page and all its child pages ?

    add_filter('avf_logo_link','av_change_logo_link');
    function av_change_logo_link($link)
    {
        if(is_page(17806) || $post->post_parent == '17806')
        {
        $link = "PAGE TITLE";
        }
        return $link;
    }
    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        if(is_page(17806) || $page->page_parent == '17806')
        {
        $logo = "http://ca.wishschool.net/assets/img/wish-logo.png";
        }
        return $logo;
    }

    That’s what I am having so far.

    And I would like to make this Child Page a same logo as This Page.

    Best Regards

    #837705

    Hi,

    In your codes, the global $post is still missing. Please check it carefully.

    add_filter('avf_logo','av_change_logo');
    function av_change_logo($logo)
    {
        global $post;
        if(is_page(17806) || $post->post_parent == '17806')
        {
        $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png";
        }
        return $logo;
    }

    Best regards,
    Ismael

    #837832

    Hi,

    I saw what you mean now.

    Cheers

    • This reply was modified 7 years, 3 months ago by Dave.
    #837836

    Hi there!

    We hope that Ismael’s solution worked for you.

    Let us know here in the forums if you need further help.

    Best regards,
    Sarah

    #838425

    Thanks Sarah you can closed this thread.
    Cheers

    #838504

    Hi,

    Thanks for letting us know. Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 19 posts - 1 through 19 (of 19 total)
  • The topic ‘Different LOGO on different pages base on Slug parentship’ is closed to new replies.