<?php // Metatag for social media
drupal_set_title($news_title);
// <!-- Search Engine -->
// <meta name="description" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'description',
'content' => $news_desc
),
), 'description');
// <meta name="image" content="URL_OF_IMG">
if(!empty($news_img))
$news_img = str_replace('http://','https://',$news_img);
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'image',
'content' => $news_img
),
), 'image');
// <!-- Schema.org for Google -->
// <meta itemprop="name" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'itemprop' => 'name',
'content' => $news_title
),
), 'itemprop-name');
// <meta itemprop="description" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'itemprop' => 'description',
'content' => $news_desc
),
), 'itemprop-description');
// <meta itemprop="image" content="URL_OF_IMG">
if(!empty($news_img))
$news_img = str_replace('http://','https://',$news_img);
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'itemprop' => 'image',
'content' => $news_img
),
), 'itemprop-image');
// <!-- Twitter -->
// <meta name="twitter:card" content="summary">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'twitter:card',
'content' => $news_desc
),
), 'twitter:card');
// <meta name="twitter:title" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'twitter:title',
'content' => $news_title
),
), 'twitter:title');
// <meta name="twitter:description" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'twitter:description',
'content' => $news_desc
),
), 'twitter:description');
// <meta name="twitter:site" content="@lazacode">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'twitter:site',
'content' => "@myedgeprop"
),
), 'twitter:site');
// <meta name="twitter:image:src" content="URL_OF_IMG">
if(!empty($news_img))
$news_img = str_replace('http://','https://',$news_img);
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'twitter:image:src',
'content' => $news_img
),
), 'twitter:image:src');
// <!-- Open Graph general (Facebook, Pinterest & Google+) -->
// <meta name="og:title" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:title',
'content' => $news_title
),
), 'og:title');
// <meta name="og:description" content="test">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:description',
'content' => $news_desc
),
), 'og:description');
// <meta name="og:image" content="URL_OF_IMG">
if(!empty($news_img))
$news_img = str_replace('http://','https://',$news_img);
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:image',
'content' => $news_img
),
), 'og:image');
// <meta name="og:url" content="THE_CURRENT_SHOWN_URL">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:url',
'content' => url(current_path(), array('absolute' => TRUE))
),
), 'og:url');
// <meta name="og:site_name" content="lazacode.org">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:site_name',
'content' => "Edgeprop.my"
),
), 'og:site_name');
// <meta name="og:type" content="article">
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:type',
'content' => "article"
),
), 'og:type');
?>