-
AuthorPosts
-
July 4, 2018 at 10:44 pm #981362
Hello Mike, Yigit,
Thanks for your help on the previous topic. Now I would like to add a second page with a different logo again. I have tried to adjust the PHP page myself and inserted the below code at the bottom of the functiions.php file, but got a blank screen again.
Can you check if this code is correct?
Thanks, Aram———
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if (is_tree(3551)) { $logo = "http://preview.rooff.nl/wp-content/uploads/2018/06/rooff-logo-production.png"; } return $logo;
- This topic was modified 6 years, 5 months ago by steenvreter.
July 6, 2018 at 1:52 pm #982061Hey steenvreter,
Can you please check server log for error?
Can you give us temporary admin access to your website (WP dashboard) in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJuly 7, 2018 at 11:33 am #982403Hi Victoria,
login details are below.
Thanks,
Aram/SteenvreterJuly 7, 2018 at 8:00 pm #982536Hi,
The reason your code didn’t work was because the “is_tree” is for pages with parents, but the “production” page doesn’t have a parent, so I added a “elseif” & “is_page” for the production page.add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if (is_tree(1406)) { $logo = "http://preview.rooff.nl/wp-content/uploads/2018/07/rooff-logo-mngmnt.png"; } elseif ( is_page(3551) ) { $logo = "http://preview.rooff.nl/wp-content/uploads/2018/07/rooff-logo-production.png"; } return $logo; }
Please clear your browser cache and check.
Best regards,
MikeJuly 7, 2018 at 8:06 pm #982538And one curly bracket is missing on your code above.
One closes the if clause – and the second closes the function ( after return logo – as mikes code above)July 7, 2018 at 8:10 pm #982542so for a list of page you can use array or to exclude one page the is not
add_filter('avf_logo','av_change_logo'); function av_change_logo($logo){ if( is_page(21) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage21.jpg"; } elseif ( is_page( array( 42, 54, 6 ) ) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage22.jpg"; } elseif ( is_page() && !is_page(1307) ) { $logo = "http://www.domain.com/wp-content/uploads/logoforpage23.jpg"; } return $logo; }
-
AuthorPosts
- You must be logged in to reply to this topic.