• Resolved portraitflip

    (@portraitfllip)


    I use USD and euro as my currency.
    However, USD is my default currency.
    but in the search engine rankings euro is shown. I have also attached a screenshot.
    https://snag.gy/n6CVmw.jpg
    Please check and let me know how can this issue be resolved.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello

    Try to add this code in functions.php

    function isBot(&$botname = ”){
    $bots = array(
    ‘rambler’,’googlebot’,’aport’,’yahoo’,’msnbot’,’turtle’,’mail.ru’,’omsktele’,
    ‘yetibot’,’picsearch’,’sape.bot’,’sape_context’,’gigabot’,’snapbot’,’alexa.com’,
    ‘megadownload.net’,’askpeter.info’,’igde.ru’,’ask.com’,’qwartabot’,’yanga.co.uk’,
    ‘scoutjet’,’similarpages’,’oozbot’,’shrinktheweb.com’,’aboutusbot’,’followsite.com’,
    ‘dataparksearch’,’google-sitemaps’,’appEngine-google’,’feedfetcher-google’,
    ‘liveinternet.ru’,’xml-sitemaps.com’,’agama’,’metadatalabs.com’,’h1.hrn.ru’,
    ‘googlealert.com’,’seo-rus.com’,’yaDirectBot’,’yandeG’,’yandex’,
    ‘yandexSomething’,’Copyscape.com’,’AdsBot-Google’,’domaintools.com’,
    ‘Nigma.ru’,’bing.com’,’dotnetdotcom’
    );
    foreach($bots as $bot)
    if(stripos($_SERVER[‘HTTP_USER_AGENT’], $bot) !== false){
    $botname = $bot;
    return true;
    }
    return false;
    }
    add_action(‘wp_head’, function(){
    if( isBot() ){
    if (class_exists(‘WOOCS’)) {
    global $WOOCS;
    $WOOCS->reset_currency();
    }
    }
    });

    Thread Starter portraitflip

    (@portraitfllip)

    Your PHP code changes were rolled back due to an error on line 14 of file wp-content/themes/flatsome/functions.php. Please fix and try saving again.

    syntax error, unexpected ‘amp’ (T_STRING), expecting variable (T_VARIABLE)

    Kindly provide a solution to this error which comes up while updating with new code.
    Thanks

    Hello
    Try it please:

    function isBot($botname = ''){
    $bots = array(
    'rambler','googlebot','aport','yahoo','msnbot','turtle','mail.ru','omsktele',
    'yetibot','picsearch','sape.bot','sape_context','gigabot','snapbot','alexa.com',
    'megadownload.net','askpeter.info','igde.ru','ask.com','qwartabot','yanga.co.uk',
    'scoutjet','similarpages','oozbot','shrinktheweb.com','aboutusbot','followsite.com',
    'dataparksearch','google-sitemaps','appEngine-google','feedfetcher-google',
    'liveinternet.ru','xml-sitemaps.com','agama','metadatalabs.com','h1.hrn.ru',
    'googlealert.com','seo-rus.com','yaDirectBot','yandeG','yandex',
    'yandexSomething','Copyscape.com','AdsBot-Google','domaintools.com',
    'Nigma.ru','bing.com','dotnetdotcom'
    );
    foreach($bots as $bot)
    if(stripos($_SERVER['HTTP_USER_AGENT'], $bot) !== false){
    $botname = $bot;
    return true;
    }
    return false;
    }
    add_action('wp_head', function(){
    if( isBot() ){
    if (class_exists('WOOCS')) {
    global $WOOCS;
    $WOOCS->reset_currency();
    }
    }
    });
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing different currency on search engine’ is closed to new replies.