-
AuthorPosts
-
August 9, 2024 at 8:27 pm #1464276
Hi,
I was able to alter PHP to change logo per page id but only works when scroll down page. Is there a css function that i can hide the logo that appears on certain page id’s? Thanks!
August 10, 2024 at 3:35 pm #1464323Hey lobstahhhhhhh,
It sounds like your function is only changing the standard logo and not the transparent logo, typically these are two different logos.
For the standard logo use this function:add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if(is_page(206) ) { $logo = "https://kriesi.at/themes/enfold-business-flat/wp-content/uploads/sites/43/2014/08/logo_flat_portfolio.png"; } return $logo; }
for the transparent logo use this function:
function av_change_alt_logo_img($header){ if(is_page(206) ){ $header['header_replacement_logo'] = "https://kriesi.at/themes/enfold-startup/wp-content/uploads/sites/47/2015/02/logo_coming_soon.png"; } return $header; } add_filter('avf_header_setting_filter','av_change_alt_logo_img');
If you want both to be the same image, you can also do that.
Best regards,
MikeAugust 16, 2024 at 8:17 pm #1464794Thank you so much!
How do I make it so both of these logos point to a specific page on the site (not the home page)?August 17, 2024 at 1:40 pm #1464810Hi,
You will want to change the page ID in the code above: if(is_page(206)
so change “206” to your page IDBest regards,
MikeAugust 21, 2024 at 1:00 pm #1465072Thank you! I am sorry, I did not explain properly.
In the previous posts on this thread, you showed me how to put two different logos on same website. We have a market with two different locations. The page 206 in your example is the page ID’s where these secondary logos show.
The code you gave me was great, but I need to have those logos direct to a page other than the home page, when you click on them. How do I do this? Thanks!
August 21, 2024 at 4:54 pm #1465104Hi,
Ok, so you also want to change the logo link on a certain page.
Add this code to the end of your child theme functions.php file in Appearance ▸ Editor:// to change the logo link add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link) { if(is_page(206) ) { $link = "https://your-new-link.com"; } return $link; }
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Adjust the page ID and link to suit.Best regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.