简体   繁体   中英

facebook like button website description

I've added a Facebook like button to my website , by following these instructions . Basically, I added this HTML:

<div class="fb-like" data-href="http://www.festivals.ie" 
    data-send="false" data-width="100"data-show-faces="false" data-font="verdana"     
    data-layout="button_count">
</div>

And this JavaScript:

(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s);
    js.id = id;
    js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&appId=29208799875673";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

When the button is pressed, the following popout appears:

在此处输入图像描述

The popout contains some text that describes the website (circled in red). This text seems to be copied from the first non-empty <p> element that appears on the page (starting from the top).

Is there a way that I can change this to something that better describes the site? I tried adding a

<meta name="description" content="my website description"/>

But it didn't make any difference.

Use the opengraph description meta tag. You might also want to add the title unless your page title is always what you want to appear on Facebook.

<meta property="og:title" content="..." />
<meta property="og:description" content="..." />

See https://developers.facebook.com/docs/opengraph/objects/ for further information.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM