任何想法为什么facebook喜欢按钮不会在wordpress博客上显示非英文字母?

时间:2011-12-20 08:51:10

标签: facebook html5 wordpress

所有非英语(立陶宛语)元素,如š,ė,ž,č等,都显示为看起来不错的代码。我在我的wordpress博客上添加了一个类似facebook的按钮,看起来像这样:

<iframe src="http://www.facebook.com/plugins/like.php?locale=lt_LT&href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; position: relative; top: -150px; padding: 0 0 20px 0; overflow:hidden; width:450px; height:60px"></iframe> 

你可以看到我添加了locale=lt_LT(我来自立陶宛)

DOCTYPE:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

我正在使用这个:

<?php
    $thumb = get_post_meta($post->ID,'_thumbnail_id',false);
    $thumb = wp_get_attachment_image_src($thumb[0], false);
    $thumb = $thumb[0];
    $default_img = get_bloginfo('stylesheet_directory').'/images/default_icon.jpg';

    ?>


    <?php if(is_single() || is_page()) { ?>
        <meta property="og:type" content="article" />
        <meta property="og:title" content="<?php single_post_title(''); ?>" />
        <meta property="og:description" content="<?php
        while(have_posts()):the_post();
        $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", get_the_excerpt());
        echo apply_filters('the_excerpt_rss', $out_excerpt);
        endwhile;   ?>" />
        <meta property="og:url" content="<?php the_permalink(); ?>"/>
        <meta property="og:image" content="<?php if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
    <?php  } else { ?>
        <meta property="og:type" content="article" />
       <meta property="og:title" content="<?php bloginfo('name'); ?>" />
        <meta property="og:url" content="<?php bloginfo('url'); ?>"/>
        <meta property="og:description" content="<?php bloginfo('description'); ?>" />
        <meta property="og:image" content="<?php  if ( $thumb[0] == null ) { echo $default_img; } else { echo $thumb; } ?>" />
    <?php  }  ?>

DOCTYPE或其他什么问题?

2 个答案:

答案 0 :(得分:2)

http://developers.facebook.com/docs/reference/plugins/like/订购按钮时按钮的语言设置 按钮应该具有根据用户的语言。示例

js.src = "/ / connect.facebook.net / es_LA / all.js # xfbml = 1 & appId = 250867014982684";

表示您可以修改代码es_LA语言的那一行。这是html 5.

答案 1 :(得分:0)

好的,对于喜欢的按钮,请尝试使用fb开发者页面并获取htlm5的代码;而不是iframe。我前段时间用西班牙语制作按钮,让我检查一下我的代码。我会告诉你的。