Hi Riccardo, I am not too sure on how to achieve your goal. However if you set up your image to open up in it’s own URL then you should be able to share that URL in Facebook.
Also you might want to try the following although I can’t guarantee that it will work. Add a Facebook share shortcode to the image description. Try and see what you get.
Kind regards
Hi mbrsolution,
i’m already able to share the right link but in the share FB there is the wrong image.
Please, look at LINK
Riccardo
Hi Riccardo, the URL link above shows that you are able to share your blog post or image in Facebook, which is good.
Now, let me me see if I am getting what you are saying. What is happening when you click on the Facebook share link is, that the image of the dog is not being pulled by the Facebook share button is this correct?
What image is the share button grabbing? Also sometimes when you click on a share button it also gives you options to select other images within the post, is that option available to you when you click on the share button?
Kind regards
Mbrsolution, you are right!
The dog, which you are seeing, is the default og:image sets by YOAST plugin [IMG]. I would like to replace that image with the image of Nalam (the dog of the post).
In this case, in the HEAD, this row must be inserted
<meta property="og:image" content="http://##########.it/wp/wp-content/uploads/catablog/thumbnails/cane-nalam.jpg"/>
Expected result
Hi Riccardo, where is that image coming from? What YOAST plugin are you using that is currently pulling that image?
Kind regards
Hi mbrsolution,
I’m using Yoast SEO and, for FB, it is possible to set a default image IMG (form me it’s the homepage image).
Look at here.
When user click on the dog image, it’ s redirected to a post page but there is not the featured image/thumbnail image/og:image set, so when user clicks on “share FB”, the default image is selected.
Hi Riccardo have you tried not to use that option in YOAST SEO plugin. Or maybe ask on their forum if there is a way to change the default image?
In fact it really has nothing to do with CataBlog. It is more the way YOAST SEO implements it’s Facebook image sharing options.
Kind regards
Hi mbrsolution. I believe that you are wrong.
Yoast SEO takes the thumbnail from the post.
When Catablog creates the post, in my single-catablog-items.php
if I check
if ( has_post_thumbnail() ) {
I obtain FALSE. This means that catablog doesn’t set the featured image of the post.
Is there a way to tell catablog to set the featured image?
Riccardo
Hello Riccardo, you probably are correct.
The only way that I can think of is by integrating CataBlog with your theme. You have to read Zach’s instructions.
It is the only way you will achieve it without having to hack the code or add any code into the function.php file. Those two files control how CataBlog functions on your website.
What do you think?
Kind regards
I see the light at the end of tunnel!
My single-catablog-items.php calls get_headers function, so I put in the HEAD section of header.php this code
<?php
$data= get_post_meta(get_the_ID(), 'catablog-post-meta', true);
if (!empty($data)) {
echo '<meta property="og:image" content="'. wp_upload_dir()['baseurl'] . '/catablog/originals/'.$data["image"].'" />'."\n";
}
?>
The meta tag is inserted and facebook share is now ok
Hello Riccardo has the above resolved your issue? Maybe I could add the above in one of my tutorials 🙂
Kind regards
Yes you can!
Remember that facebook needs at least a 200×200 image and yoast seo for the other tags.
just for asking a future feature.
The standard image or subimages usually are not suitable for facebook sharing. FB requires a 1500×1500 thumbnail, so it will be nice if Catablog could provide:
– share_thumbnail_image (same method used for Image and Subimage)
– specific folder in wp_content/uploads/catablog (as for originals)
– hash value in $data= get_post_meta
Riccardo
Edit: final custom solution:
<?php
$data= get_post_meta(get_the_ID(), 'catablog-post-meta', true);
if (!empty($data)) {
echo '<meta property="og:image" content="'. wp_upload_dir()['baseurl'] . '/catablog_share/'.$data["image"] . '" />' . "\n";
}
?>
Hello Riccardo, is the FB required entry above correct 1500×1500. It looks a bit too big?
Kind regards
https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/
Use high-resolution images (preferably 1500 pixels wide). Use multiple images if you want to give us multiple thumbnail candidates.
Use images that are at least 1200 x 630 pixels for the best display on high resolution devices