WordPress.org

Forums

ShareThis: Share Buttons and Social Analytics
[Plugin: ShareThis: Share, Email, Tweet, Like, +1 Made Simple] Unable to set custom st_image propert (2 posts)

  1. Bryce Corkins
    Member
    Posted 3 years ago #

    I'm using the sharethis plugin for wordpress and I'm having some issues with my featured image not appearing when I share a post on facebook. I'm trying to override this by specifying an 'st_image' parameter in the HTML code settings on the options page. I've modified the facebook share button to the following:

    <span class='st_facebook_hcount' st_title='<?php the_title(); ?>' st_url='<?php the_permalink(); ?>' st_image='<?php echo wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>' displayText='share'>

    However, for some reason, the PHP after st_image= doesn't get parsed. The code renders on the page as:

    <span class="st_facebook_hcount" st_title="A simple choice" st_url="http://www.alpha-i.net/blog/meditation/a-simple-choice/" st_image="<?php wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?>" displaytext="share"></span>

    Is this a bug in the plugin? Any suggestions would be appreciated.

    http://wordpress.org/extend/plugins/share-this/

  2. sharethissupport
    Member
    Posted 3 years ago #

    Hi,
    The ShareThis widget tries to automatically pick the best image from the url you share , but sometimes our algorithm doesn't pick it up for some reason or another.

    Sharethis facebook button implements a direct post, meaning user is redirected to the website. Because of this, Facebook is responsible for crawling information from the page. They do this via meta tags. If these tags do exist on the page, Facebook will display that information in the post.

    Facebook uses properties “description” and “title” in the meta tags.

    WordPress has ways to put meta tags. Typically, this is done in the header.php template for the theme.

    http://codex.wordpress.org/Meta_Tags_in_WordPress

    There are also wordpress plugins that setup these tags automatically. Yoast WordPress SEO is one of them.

    Regards,
    Neelam

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • ShareThis: Share Buttons and Social Analytics
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags