I want Facebook's like and share to show the image from my K2 articles and I am trying to overcome the fact that Gavick's OpenGraph plugin is not currently working with K2 articles. I've tried Easy Open Graph, but that plugin adds multiple og:url to the page, which throws errors on Facebook's debugging page.
I want to add the code below to /html/com_k2/templates/default/item.php, but there is no $doc in that php file. Please help me add this to item.php. Thanks in advance!
- Code: Select all
$doc->setMetaData( 'og:image', 'http://www.images.com/image.png' );
A related post here:
https://www.gavick.com/forums/league-news/wrong-title-and-picture-when-posting-on-facebook-17635.html supposedly makes a similar change to /layouts/blocks/head.php, but when I add that code, the meta content comes out in BODY, not in HEAD, and the several "meta content" lines are nested within eachother. Again, thanks in advance.
Al