- Posts: 18
COMMUNITY FORUM
Facebook shares wrong image SOLVED
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
12 years 1 month ago - 12 years 1 month ago #111907
by ataman79
Facebook shares wrong image SOLVED was created by ataman79
Hello I am using k2 2.6.5 and using the integrated share button of facebook. But when I share something to facebook it shares a wrong image. Can someone help me solving the problem ?
Please Log in or Create an account to join the conversation.
- Albert
-
- Offline
- Senior Member
Less
More
- Posts: 79
12 years 1 month ago - 12 years 1 month ago #111908
by Albert
Replied by Albert on topic Re: Facebook shares wrong image
I haven't tried this, but you can try adding this to the very top of item.php
It will grab the article main image. The meta is part of Facebook Open Graph. Great tool developers.facebook.com/tools/debug
<meta property="og:image" content="<?php echo $this->item->image; ?>"/>
It will grab the article main image. The meta is part of Facebook Open Graph. Great tool developers.facebook.com/tools/debug
Please Log in or Create an account to join the conversation.
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 18
12 years 1 month ago #111909
by ataman79
you mean to put it here ?
components/com_k2/views/item/tmpl
Replied by ataman79 on topic Re: Facebook shares wrong image
Al wrote: I haven't tried this, but you can try adding this to the very top of item.php
<meta property="og:image" content="<?php echo $this->item->image; ?>"/>
It will grab the article main image. The meta is part of Facebook Open Graph. Great tool developers.facebook.com/tools/debug
you mean to put it here ?
components/com_k2/views/item/tmpl
Please Log in or Create an account to join the conversation.
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 18
12 years 1 month ago #111910
by ataman79
Replied by ataman79 on topic Re: Facebook shares wrong image
Ok I put the code in the k2->templates->my template , item.php,
but it didn't work
Any other suggestions ?
but it didn't work
Any other suggestions ?
Please Log in or Create an account to join the conversation.
- ataman79
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 18
12 years 1 month ago - 12 years 1 month ago #111911
by ataman79
Replied by ataman79 on topic Re: Facebook shares wrong image SOLVED
Actually I manage to solve the problem. There was missing og:image metatag, so here how can I fixed it:
in my k2 template, in item.php , at the very top I added next lines:
in my k2 template, in item.php , at the very top I added next lines:
Log in or Create an account to join the conversation.
- YannisDr
-
- Offline
- Junior Member
Less
More
- Posts: 28
11 years 3 months ago - 11 years 3 months ago #111912
by YannisDr
Replied by YannisDr on topic Re: Facebook shares wrong image SOLVED
There is no change when I implement this, so I guess that it is now taken care of in a native way from K2. My problem is that in order to be able to post it on Facebook, I need to have a central tiny 200x200px image which seems too little against the body (text).
Please Log in or Create an account to join the conversation.