-
AuthorPosts
-
July 25, 2019 at 9:26 am #1121844
Hi there!
I want to change the logo on several pages. Found in this forum an answer:
Open up wp-contentthemesenfoldframeworkphpfunction-set-avia-frontend.php and replace:
$logo = "<img src=".$logo." alt='' />";
withif(is_page('25')) $logo = 'http://mywebsite.com/second_logo.jpg'; $logo = "<img src=".$logo." alt='' />";
But I can’t find the php file. Does it still excist? It’s an answer from 2013! If it does, where to find?
I also tried changing the logo with CSS but it’s not totally working. I added some CSS for my default logo:
.responsive .logo { display: block !important; } .logo, .logo a { overflow: visible !important; } .logo img { height: 250%; max-height: 360px !important; } .logo { margin-top: -100px; margin-left: -200px; } #header_main { z-index: 20; }
Now I want to change logo on specific page. Tried this:
.page-id-121 .logo img { position: absolute; height: 250%; max-height: 360px !important; } .page-id-121 .logo { background: url(https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png) no-repeat center; display: block; height: 100px; width: 300px; margin-top: -100px; margin-left: -200px; }
I see the logo is visible but totally not on the right place and it’s only visible in the top header. See link in private data! Also the default logo is still visible. Do you have any idea how to change this? It must be done at multiple pages!
Love to hear from you!
Janneke
- This topic was modified 5 years, 3 months ago by jannnnnneke.
July 25, 2019 at 5:52 pm #1121953if you are using a child-theme ( and i alway recommend that) you can replace the logo by adding something like this to your child-theme functions.php
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo){ if( is_page(121) ) { $logo = "https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png"; } return $logo; }
btw: you can have more substitutions like this way with all conditional possiblities you like:
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo){ if( is_page(121) ) { $logo = "https://bright.itsomimedia.nl/wp-content/uploads/Bright_academy_bgwit3.png"; } if ( is_page( array( 42, 54, 6 ) ) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage22.jpg"; } if ( is_page() && !is_page(1307) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg"; } return $logo; }
etc. pp.
July 26, 2019 at 5:01 am #1122053Hi,
Thanks for helping out @guenni007, did that answer your question @jannnnnneke?
Best regards,
RikardAugust 12, 2019 at 10:45 am #1126754Yes, perfect!
How can I change the logo for portfolio items? That ID isn’t working (post id: 338).
Thanks!
August 16, 2019 at 8:27 am #1128165Hi,
I checked your site but the cache is enabled. Please follow the steps mentioned in the previous ticket and clear the cache.
Once the cache is cleared you should be able to view the changes correctly.
If yous till have any issue please share the link to the portfolio item page so we can take a closer look at it.
Best regards,
VinayAugust 20, 2019 at 2:54 pm #1129230Hi there,
I cleared cache but didnt work.
I tried adding CSS for specific page and that also didn’t work for the portfolio items. See https://kriesi.at/support/topic/changing-header-color-for-only-one-page/#post-1129229
Thanks!
August 22, 2019 at 4:28 am #1129835Hi,
Thank you for the update.
You need to use the “is_single” conditional function instead of “is_page” for portfolio items.
// https://developer.wordpress.org/reference/functions/is_single/
Best regards,
IsmaelAugust 22, 2019 at 3:14 pm #1129996Yes, perfect!! “is_single” is working!
Thanks Ismael!
August 23, 2019 at 5:29 am #1130190Hi,
Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardSeptember 17, 2019 at 3:30 pm #1139139Is it possible to change the link of logo? Now all the logo’s are going to homepage when you click on it. But i would like to change that on a few pages. I’m using the function.php code guenni007 sent!
Thanks a lot!
September 19, 2019 at 5:25 am #1139782Hi,
Yes, that’s possible. You can use the “avf_logo_link” filter for that. An example can be found in the following thread.
// https://kriesi.at/support/topic/different-logo-for-different-websites-subpages/
Thank you for the update.
Best regards,
IsmaelAugust 17, 2021 at 6:17 pm #1317192It’s not working for me – I changed the page number – Changed the link and added to the child PHP functions… what am I missing?
I want this logo: https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png
On this page only: https://www.vfsfire.com/national/
Added this code:
add_filter(‘avf_logo’,’av_change_logo’);
function av_change_logo($logo)
{
if(is_page(830) )
{
$logo = “https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png”;
}
return $logo;
}
Screenshot of the PHP child functions page with code added
https://www.vfsfire.com/wp-content/uploads/2021/08/Screen-Shot-2021-08-17-at-9.13.07-AM.pngAugust 19, 2021 at 1:32 am #1317393OK, how long should I usually wait for a reply. Got help: This worked:
add_filter(‘avf_header_setting_filter’,’avf_header_setting_filter_mod’);
function avf_header_setting_filter_mod($header)
{
if( is_page(‘830’) ){
$header[‘header_replacement_logo’] = “https://www.vfsfire.com/wp-content/uploads/2021/08/VFS_brand-identity_RGB_HZL_Signature_black.png”;
}
return $header;
}Still doesn’t work on mobile but I’ll take 50%.
August 19, 2021 at 6:12 am #1317435 -
AuthorPosts
- The topic ‘Change logo on specific pages’ is closed to new replies.