Skip to content

Instantly share code, notes, and snippets.

@Uriel29
Last active August 29, 2015 14:24
Show Gist options
  • Save Uriel29/d425822a427db637e521 to your computer and use it in GitHub Desktop.
Save Uriel29/d425822a427db637e521 to your computer and use it in GitHub Desktop.
Tags OG (facebook) e metatags Google para add no content do Seblod
<?php
$descri = substr ($cck->get('seu_texto')->value ,0,170);
$urlsite = JURI::current(); //pega a URL do artigo current (ao vivo)
$doc =JFactory::getDocument();
$doc->addCustomTag( '<meta property="og:url" content="'.$urlsite.'" />' );
$doc->addCustomTag( '<meta property="og:image" content="http://site.com/images/image.png" />' );
$doc->addCustomTag( '<meta property="og:description" content="'.$descri.'" />' );
$doc->addCustomTag( '<meta property="og:site_name" content="Oceano Literário" />' );
$doc->addCustomTag( '<meta property="og:type" content="website" />' );
$doc->addCustomTag( '<meta name="description" content="'.$descri.'" />' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment