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?
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);
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With