在每篇 joomla 文章中添加不同的元标记

发布于 2024-11-05 07:11:19 字数 914 浏览 0 评论 0原文

我想在我的 joomla 网站中添加 facebook open graph 标签。 我编辑了index.php并手动添加:

<head>
    <title>The Rock (1996)</title>
    <meta property="og:title" content="The Rock"/>
    <meta property="og:type" content="movie"/>
    <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
    <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
    <meta property="og:site_name" content="IMDb"/>
    <meta property="fb:admins" content="USER_ID"/>
    <meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>

  </head>

这样元标记就应用于我的所有网站页面。

如何为每篇 joomla 文章添加不同的元标记?

I'd like to add facebook open graph tags in my joomla website.
I edited index.php and add manually:

<head>
    <title>The Rock (1996)</title>
    <meta property="og:title" content="The Rock"/>
    <meta property="og:type" content="movie"/>
    <meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
    <meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
    <meta property="og:site_name" content="IMDb"/>
    <meta property="fb:admins" content="USER_ID"/>
    <meta property="og:description"
          content="A group of U.S. Marines, under command of
                   a renegade general, take over Alcatraz and
                   threaten San Francisco Bay with biological
                   weapons."/>

  </head>

In this way meta tags is applied to all my website pages.

How can I add different meta tags for every joomla article?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

柒夜笙歌凉 2024-11-12 07:11:19

这篇文章解释了拼接元标记的基本方法。

$opengraph    = '<meta property="og:title" content="'.$game->title.'"/>' ."\n";
$opengraph .= '<meta property="og:type" content="'."BLOG_replacewithyourtype".'"/>' ."\n";
$opengraph .= '<meta property="og:url"  content="'. $myabsoluteurl.'"/>' ."\n";
$opengraph .= '<meta property="og:image" content="'."http://YOURSITE.com/.../images/".$blog->imagename.'"/>' ."\n";
$opengraph .= '<meta property="og:site_name" content="'."YOUR SITE TITLE".'"/>' ."\n";
$opengraph .= '<meta property="fb:admins" content="'."YOUR FACE BOOK DEVELOPER CODE".'"/>' ."\n";
//add the tags to the head of the page;[/
$document->addCustomTag($opengraph);

A basic method of stitching the meta tags is explained in this article.

$opengraph    = '<meta property="og:title" content="'.$game->title.'"/>' ."\n";
$opengraph .= '<meta property="og:type" content="'."BLOG_replacewithyourtype".'"/>' ."\n";
$opengraph .= '<meta property="og:url"  content="'. $myabsoluteurl.'"/>' ."\n";
$opengraph .= '<meta property="og:image" content="'."http://YOURSITE.com/.../images/".$blog->imagename.'"/>' ."\n";
$opengraph .= '<meta property="og:site_name" content="'."YOUR SITE TITLE".'"/>' ."\n";
$opengraph .= '<meta property="fb:admins" content="'."YOUR FACE BOOK DEVELOPER CODE".'"/>' ."\n";
//add the tags to the head of the page;[/
$document->addCustomTag($opengraph);
很酷又爱笑 2024-11-12 07:11:19

如果您愿意,您可以使用 Joomla 标准内容的 Open Graph 插件之一。
也许就像 http://itprism.com/free- joomla-extensions/social-marketing-seo/open-graph-meta

You can use one of the Open Graph Plugins for Joomla standard content if you like.
Maybe like http://itprism.com/free-joomla-extensions/social-marketing-seo/open-graph-meta

把时间冻结 2024-11-12 07:11:19

您可以通过管理后端的导航菜单向每篇文章添加特定元。当查看特定的导航项时,每个父级和子级都有自己的元字段,可通过右侧的下拉菜单找到。

You can add specific meta to each article via the navigation menu in the administratio0n back end. Each parent and child has its own meta fields located via the dropdowns on the right hand side when viewing a particular navigation item.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文