-
AuthorPosts
-
June 27, 2024 at 7:50 pm #1459883
1 tried this code in the php file but its not working, its showing as broken link
i used the below code in the Enfold: config-include.php file// Change Logo image
add_filter(‘avf_logo’,’av_change_logo_img’);function av_change_logo_img($img)
{
if( is_page(‘teen-and-young-adult-care’) )
{
$img = “The-Teen-and-Young-Adult-Care-Center.png”;
}
if( is_page(‘teen-and-young-adult-services’) )
{
$img = “The-Teen-and-Young-Adult-Care-Center.png”;
}
if( is_page(‘teen-and-young-adult-news’) )
{
$img = “The-Teen-and-Young-Adult-Care-Center.png”;
}return $img;
}June 27, 2024 at 11:11 pm #1459899Hey mnydish,
I see a few issues, first the code should be in your child theme functions.php file, second your images don’t have the full path, third I recommend using the page ID instead of the page or post title, please see this example:add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if(is_page(1301) ) { $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png"; } if(is_page(1410) ) { $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo.png"; } if(is_page(1286) ) { $logo = "http://kriesi.at/wp-content/themes/kriesi/images/logo2.png"; } return $logo; }
See this thread.
Best regards,
MikeJune 28, 2024 at 12:30 am #1459906This reply has been marked as private.June 28, 2024 at 5:06 am #1459914Hi,
Thank you for the update.
I’m not running a child theme Just enfold
If you’re not running a child theme, you can add the code to the parent theme’s functions.php file, or you can install a code snippet plugin such as the following:
// https://wordpress.org/plugins/code-snippets/
// https://wordpress.org/plugins/insert-php-code-snippet/Best regards,
IsmaelJune 28, 2024 at 12:24 pm #1459957This reply has been marked as private.June 29, 2024 at 12:42 pm #1460047Hi,
Please include an admin login in the Private Content area so we can investigate better.Best regards,
MikeJune 29, 2024 at 12:48 pm #1460049This reply has been marked as private.June 29, 2024 at 6:23 pm #1460225Hi,
I tried to adjust your function in your plugin but it seems to have caused an error, please include FTP access in the Private Content area so we can try to correct.Best regards,
MikeJune 29, 2024 at 6:33 pm #1460235This reply has been marked as private.June 29, 2024 at 7:37 pm #1460280Hi,
Thanks, I corrected the issue and disabled your plugin and enabled your wpcode plugin and added this snippet:add_filter('avf_logo','av_change_logo'); function av_change_logo($logo) { if(is_page('teen-and-young-adult-care-center') ) { $logo = "/wp-content/uploads/2024/06/The-Teen-and-Young-Adult-Care-Center.png"; } if(is_page('teen-and-young-adult-services') ) { $logo = "/wp-content/uploads/2024/06/The-Teen-and-Young-Adult-Care-Center.png"; } if(is_page('teen-and-young-adult-news') ) { $logo = "/wp-content/uploads/2024/06/The-Teen-and-Young-Adult-Care-Center.png"; } return $logo; }
please check.
Best regards,
MikeJune 29, 2024 at 8:01 pm #1460302Perfect!!! thank you
one more question
If I wanted to show both logos on the site side by side on the home page is there a way to do that?June 29, 2024 at 8:13 pm #1460312Hi,
I recommend making a new image from the two logos, and then adding a new option to show the new logo.Best regards,
MikeJune 29, 2024 at 8:33 pm #1460326Thanks MIke
If I wanted the second logo to link to another page is there a way to do that?June 29, 2024 at 8:57 pm #1460345Hi,
To change the logo link for the four pages I added this code in your wpcode plugin:add_filter('avf_logo_link','av_change_logo_link'); function av_change_logo_link($link) { if(is_page( array(132, 594, 598, 518) ) ) { $link = "https://pediatriccarec.wpenginepowered.com/teen-and-young-adult-care-center/"; } return $link; }
please check.
Best regards,
MikeJune 29, 2024 at 10:09 pm #1460391perfect thank you!
June 29, 2024 at 10:16 pm #1460396Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘change logo on one page’ is closed to new replies.