英文:
How to remove facebook like button social text?
问题
我想删除Facebook点赞按钮上的社交文本,以适应宽度,您可以看到图像1。
我已经阅读了文章。
但当我访问https://developers.facebook.com/docs/reference/plugins/like/时,我可以更改“布局为button_count”,但我找不到“取消勾选发送按钮”。我该怎么做?
顺便说一下,在官方网站上,可以显示没有文本的点赞按钮,您可以看到图像2。
图像1
图像2
英文:
I would like to remove the social text from the facebook like button in order to fit into the width, you can see Image 1.
I have read the article.
But when I access https://developers.facebook.com/docs/reference/plugins/like/ , I can change the "layout to button_count", but I can't find "uncheck send button". How can I do?
BTW, In the official website, it can display a Like Button without text, you can see Image 2.
Image 1
Image 2
答案1
得分: 1
以下是您要的内容的中文翻译部分:
你是否尝试过使用建议的代码,而不是使用Facebook按钮生成器?以下是代码示例:
<!DOCTYPE html>
<html>
<head>
<title>您的网站标题</title>
<!-- 您可以使用开放图形标签来自定义链接预览。
了解更多:https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="https://www.your-domain.com/your-page.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="您的网站标题" />
<meta property="og:description" content="您的描述" />
<meta property="og:image" content="https://www.your-domain.com/path/image.jpg" />
</head>
<body>
<!-- 加载 Facebook JavaScript SDK -->
<div id="fb-root"></div>
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/fr_FR/sdk.js#xfbml=1
&version=v16.0
&appId=YOURAPPID
&autoLogAppEvents=1"
nonce="FOKrbAYI">
</script>
<!-- 您的点赞按钮代码 -->
<div class="fb-like"
data-href="https://www.your-domain.com/your-page.html"
data-width=""
data-layout="button_count"
data-action="like"
data-size="small"
data-share="false">
</div>
</body>
</html>
英文:
Have yo tried the suggested code instead of the FB button generator ?
Here you go :
<html>
<head>
<title>Your Website Title</title>
<!-- You can use open graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="https://www.your-domain.com/your-page.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="https://www.your-domain.com/path/image.jpg" />
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/fr_FR/sdk.js#xfbml=1
&version=v16.0
&appId=YOURAPPID
&autoLogAppEvents=1"
nonce="FOKrbAYI">
</script>
<!-- Your like button code -->
<div class="fb-like"
data-href="https://www.your-domain.com/your-page.html"
data-width=""
data-layout="button_count"
data-action="like"
data-size="small"
data-share="false">
</div>
</body>
</html>
答案2
得分: 0
我测试过,这只显示了“喜欢”按钮:
<div class="fb-like"
data-href="https://developers.facebook.com/docs/plugins/"
data-width="500"
data-layout="button"
data-action="like"
data-size="small"
data-share="false"></div>
正如你所知,你应该将以下内容放在你的
标签中,并添加你的密钥:<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0" nonce="vnvxh4b9"></script>
你可以在version=v16.0
后面添加应用程序 ID,就像这样。123456789
是你的应用程序 ID:
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0&appId=123456789"
nonce="vnvxh4b9"></script>
此外,你可以使用CSS来隐藏其他内容:
.fb-like {
width: 60px !important;
overflow: hidden !important;
height: 20px !important;
}
**注意:如果你想在按钮上显示计数,只需将data-layout="button"
更改为以下内容:
data-layout="button_count"
并相应地增加CSS中的宽度!
英文:
I tested and this only shows like button:
<div class="fb-like"
data-href="https://developers.facebook.com/docs/plugins/"
data-width="500"
data-layout="button"
data-action="like"
data-size="small"
data-share="false"></div>
As you know you should have this in your head tag and also add your keys to it:
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0" nonce="vnvxh4b9"></script>
You can add app ID after version=v16.0
like this. 123456789
is your app ID:
```html
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0&appId=123456789"
nonce="vnvxh4b9"></script>
Also you can use CSS to hide everything else:
```css
.fb-like {
width: 60px !important;
overflow: hidden !important;
height: 20px !important;
}
**Note: If you want to show count on button just change data-layout="button"
in the div to
data-layout="button_count"
And respectfully increase the width if you use CSS!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论