• Resolved Shivani-Rana

    (@shivani-rana)


    Hi

    I am using Q translate plugin. I want change logo URL when i am on french language.
    Currently it show default language link(i.e English)
    here is my coding:-

    <!– Get Logo –>

    <div class=”logo-wrapper”>
    <?php

    $logo_id = get_option(THEME_SHORT_NAME.’_logo’);

    if( empty($logo_id) ){

    $alt_text = ‘default-logo’;

    $logo_attachment = GOODLAYERS_PATH . ‘/images/default-logo.png’;

    }else{

    $alt_text = get_post_meta($logo_id , ‘_wp_attachment_image_alt’, true);

    $logo_attachment = wp_get_attachment_image_src($logo_id, ‘full’);

    $logo_attachment = $logo_attachment[0];

    }

    if( is_front_page() ){

    echo ‘<h1><img src=”‘ . $logo_attachment . ‘” alt=”‘ . $alt_text . ‘”/></h1>’;

    }else{

    echo ‘<a href=”‘;

    echo home_url();

    echo ‘”><img src=”‘ . $logo_attachment . ‘” alt=”‘ . $alt_text . ‘”/>’;

    }

    ?>
    </div>

    Please help me

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Shivani-Rana

    (@shivani-rana)

    hi,
    I resolved this issue

    You have to just Add this line in header.php:-
    $currentLang = qtrans_getLanguage();

    After this add some line like this:-

    if( is_front_page() ){

    echo ‘<h1><a href=”‘;

    if($currentLang==’fr’)
    echo home_url().’/fr/’;
    else
    echo home_url();

    echo ‘”><img src=”‘ . $logo_attachment . ‘” alt=”‘ . $alt_text . ‘”/></h1>’;

    }else{

    echo ‘<a href=”‘;

    if($currentLang==’fr’)
    echo home_url().’/fr/’;
    else
    echo home_url();

    echo ‘”><img src=”‘ . $logo_attachment . ‘” alt=”‘ . $alt_text . ‘”/>’;

    }

    ?>

    Thread Starter Shivani-Rana

    (@shivani-rana)

    resolved see my above post

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Qtranslator logo link issue’ is closed to new replies.