-
AuthorPosts
-
July 27, 2017 at 8:30 am #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/page3Regards
July 30, 2017 at 7:06 am #831711Hey longlife0428,
Please, may you provide to us your website link and the WP and FTP credentials?
Best regards,
John TorvikJuly 31, 2017 at 5:23 am #831954Hey John,
Thanks for your feedback.
Check the credentials below
Regards
August 2, 2017 at 5:39 am #833161Hi Team,
Any though of that?
Please let me know if that is not possible.
Regards
August 3, 2017 at 2:52 pm #833908Hi,
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,
YigitAugust 4, 2017 at 6:38 am #834174August 4, 2017 at 10:16 am #834254Hi,
Can you post a link to your “Canada” page and to its child pages?
Best regards,
YigitAugust 4, 2017 at 11:56 am #834299Hi Yigit,
Refer this link:
I am trying to make all the links on this pages same logo.
Regards
August 4, 2017 at 12:45 pm #834320Hi,
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,
YigitAugust 4, 2017 at 1:03 pm #834323Hi 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
August 9, 2017 at 7:52 am #836213Hi,
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,
IsmaelAugust 9, 2017 at 9:08 am #836235Hi 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.
August 10, 2017 at 8:57 am #836818Hi,
The global variable “$post” has been left out. We included it in the filter. Please try it again.
Best regards,
IsmaelAugust 10, 2017 at 12:05 pm #836925Hi 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
August 12, 2017 at 4:20 am #837705Hi,
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,
IsmaelAugust 12, 2017 at 12:25 pm #837832August 12, 2017 at 12:33 pm #837836Hi there!
We hope that Ismael’s solution worked for you.
Let us know here in the forums if you need further help.
Best regards,
SarahAugust 14, 2017 at 4:51 am #838425Thanks Sarah you can closed this thread.
CheersAugust 14, 2017 at 10:07 am #838504 -
AuthorPosts
- The topic ‘Different LOGO on different pages base on Slug parentship’ is closed to new replies.