Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #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;
    }

    #1459899

    Hey 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,
    Mike

    #1459906
    This reply has been marked as private.
    #1459914

    Hi,

    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,
    Ismael

    #1459957
    This reply has been marked as private.
    #1460047

    Hi,
    Please include an admin login in the Private Content area so we can investigate better.

    Best regards,
    Mike

    #1460049
    This reply has been marked as private.
    #1460225

    Hi,
    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,
    Mike

    #1460235
    This reply has been marked as private.
    #1460280

    Hi,
    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,
    Mike

    #1460302

    Perfect!!! 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?

    #1460312

    Hi,
    I recommend making a new image from the two logos, and then adding a new option to show the new logo.

    Best regards,
    Mike

    #1460326

    Thanks MIke
    If I wanted the second logo to link to another page is there a way to do that?

    #1460345

    Hi,
    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,
    Mike

    #1460391

    perfect thank you!

    #1460396

    Hi,
    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

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘change logo on one page’ is closed to new replies.