wrong homepage image when sharing in facebook

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Tue Oct 13, 2015 9:41 pm
Reply with quote
Report this post
Hello,
One more question. When I share an article in facebook all is ok, it is shared with the correct image ans text.
But if I try to share the homepage, facebook show several images that are not the logo. How could I fix an image to be showed when I share the homepage?? I'd like to show the logo for example or a banner, but facebook just show me different article images.
Thanks
User avatar
Senior Boarder

teitbite
Thu Oct 15, 2015 2:02 pm
Reply with quote
Report this post
Hi

If You want to use logo than best way would be to set this manually for homepage. Make sure Open Graph plugin is installed and than You will be able to determine og:image for any page.

Or You can add a code to /layout/blocks/head.php which will handle same action but from PHP side:

Code: Select all
<?php
if( JRequest::getVar('Itemid') == id-of-your-frontpage-goes-here ):
print '<meta property="og:image" content="path-to-the-file-you-want-to-use-in-facebook-share" />';
endif;
?>
User avatar
Moderator

GK User
Thu Oct 15, 2015 6:27 pm
Reply with quote
Report this post
Ok, thanks I'll try with that.
Anyway, I don't have the OG plugin installed but when I share something in facebook I don't have any problem...
User avatar
Senior Boarder

teitbite
Sun Oct 18, 2015 11:23 am
Reply with quote
Report this post
Hi

That's because articles from joomla and K2 got it's own code to create open graph meta tags. Problem may appear only on frontpage, where users are able to hide component. My script will make sure to create an extra meta details for this case only.
User avatar
Moderator


cron