New Landing How can we help? Cardinal Logo change dependant on language (using WPML – code within)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Posted in: Cardinal
  • #257135
    cobersolutions
    Member
    Post count: 54

    Hello,

    I know that Cardinal supports WPML but with the functionality I am looking for is not available within Cardinal and requires code added to the header.php/alt-header.php files. I’ve been given this piece of code by WPML so when the language switches so will the logo (each language has a logo in that language). There is some swift framework involvement when I look into the header.php/alt-header.php so I was wondering if you could guide me on the best place to add this so it integrates with Cardinal.

    Here is my support case with WPML if that helps: https://wpml.org/forums/topic/logo-change-in-language-cardinal-theme/

    <div id="logo">
    <?php
    // Website heading/logo and description text.
    if(ICL_LANGUAGE_CODE=='en'){
    $site_url = "SITE_URL";
    $site_description = "SITE_DESCRIPTION";
    $site_title = "SITE_TITLE";
    $logo = "PATH_TO_YOUR_ENGLISH_LOGO";
    }
    elseif(ICL_LANGUAGE_CODE=='fr'){
    $site_url = "SITE_URL";
    $site_description = "SITE_DESCRIPTION";
    $site_title = "SITE_TITLE";
    $logo = "PATH_TO_YOUR_FRENCH_LOGO";
    }
    echo '<a href="' . $site_url . '" title="' . $site_description . '"><img src="' . $logo . '" alt="' . $site_title . '" /></a>' . "\n";
    ?>
    </div><!-- /#logo -->
    #257558
    David Martin – Support
    Moderator
    Post count: 20834

    Hi,

    The function that output’s the logo variations is called sf_logo();, this is located in: /cardinal/swift-framework/core/sf-header.php.

    You will need to install and activate your child theme, within the child theme functions.php copy in that function and make your modifications to that.

    Thanks.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.