gpt4 book ai didi

facebook - Laravel - 社交媒体共享带有自定义内容的按钮

转载 作者:行者123 更新时间:2023-12-03 06:31:36 24 4
gpt4 key购买 nike

在 Facebook 或 google plus 上共享页面时如何自定义内容显示。 标题、描述、图像......等。当我现在在 Facebook 上分享我的页面时,它会添加除所需之外的特定图像和标题。如果使用谷歌+,图像可以正确共享,但标题仍然不是我需要的。以下是我目前使用它们的方式:

<a href="http://www.facebook.com/sharer.php?u=http://www.mywebsite.com" target="_blank"></a>

<!-- Google+ -->
<a href="https://plus.google.com/share?url=http://www.mywebsite.com" target="_blank"></a>

知道如何根据我的需要定制它,或者是否有任何软件包也可以支持我。另外,我是否需要在 facebook 或 google plus 上创建一个应用程序才能这样做。我只是使用分享按钮。

最佳答案

类似这样的 Facebook 分享

<meta property="og:title" content="title here" />
<meta property="og:image" content="image url here" />
<meta property="og:type" content="website" />

首先使用 https://developers.facebook.com/tools/debug/ 在 facebook 上调试您的页面清除您网站上的 Facebook 缓存

您不必在 facebook 上创建应用程序即可使用共享按钮,我认为这与 gplus 相同,但我不确定。

或创建此页面作为共享目标网址

<php 
$title = 'title';
$image = 'image';
?>
<meta property="og:title" content="{{$title}}" />
<meta property="og:image" content="{{$image}}" />
<meta property="og:type" content="website" />
<script>
window.location = "http://www.url-to-real-shared-page";
</script>

关于facebook - Laravel - 社交媒体共享带有自定义内容的按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28188352/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com