Support » Plugin: WPAdverts - Classifieds Plugin » Facebook sharing

  • Resolved Wp-user865966

    (@vitago)


    Hi, great plugin – We bought the whole pack, and are very happy about the product.

    Though, when sharing an add on facebook using Addtoany plugin, the image does not show.
    When using the Facebook Sharing Debugger, I can see that the “og:image” is not the one added on the product, but comming from the main page (Guess it’s a fallback, Facebook uses?).

    Is this an error in the plugin, and how do I fix this.

    Thanks for a great plugin. 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    you should be able to fix it by enabling support for “thumbnails” in the advert custom post type, adding the code below in your theme functions.php file should do that

    
    add_filter('adverts_post_type', 'my_adverts_post_type', 10, 2);
    function my_adverts_post_type($args, $type) {
      if($type != 'advert') {
        return $args;
      }
      $args["supports"][] = "thumbnail";
      return $args;
    }
    
    Thread Starter Wp-user865966

    (@vitago)

    Hi @gwin, and thanks for the fast support.

    It does not seem to work, unfortunately.

    When using the Facebook Sharing Debugger, it tells me:
    “Inferred Property The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.”

    I removed the default image, which came from Yoast, when sharing on Facebook.
    It did remove the image, but it’s still not showing the image from the classified advert.

    Tried to clear cache, did not help.

    Thanks for your help, I apreciate it.

    Thread Starter Wp-user865966

    (@vitago)

    Update: It seems that when users are adding images to the gallery (I’m using WP authors) they only make “galleries”, and are not setting the “featured” image, and therefor it wont display it in og:image.

    Is there any way to take the first image of the gallery, and set it as the ‘featured image’?

    Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    the code i sent in the last message enables WP Featured Images, go to wp-admin / Classifieds panel and edit one of the ads, then check in the right sidebar if there is a “Featured Image” widget, if it is there then the code is working properly.

    Now if in the Adverts Gallery you will mark one of the images as featured (with a “Use this image as main image” checkbox), then this image should be used in og:image tag.

    Thread Starter Wp-user865966

    (@vitago)

    Hi,

    Yeah, it seems to work as you describe.
    The issue is that not any of my users know that function exists, and wil probably never know.
    Is there any way to make the first image the default featured image automatically?

    And a feature request: Make the first image automatically the featured image. I hope you get me – It’s better to have a featured image, than not having any.

    Plugin Author Greg Winiarski

    (@gwin)

    There is a Force Featured Image snippet in the snippets library https://github.com/simpliko/wpadverts-snippets/blob/master/force-featured-image/force-featured-image.php

    You can install it as explained here https://github.com/simpliko/wpadverts-snippets/ at the bottom of the page.

    Thread Starter Wp-user865966

    (@vitago)

    Hi Greg,

    You’re amazing! Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Facebook sharing’ is closed to new replies.