Pinterest Featured Image Support

I've added the Pinterest code to Floating Social (Mind you it is very confusing what has been added manually as there is no visual indicator of what has been added)

Pinterest has a hard time grabbing the image for the page, the Image URL needs to be provided inside the code.

It is currently not possible to include PHP to fetch the image URL inside the Floating Social code box.

<a href="">Pin It</a>
<script type="text/javascript" src=""></script>
  • Kimberly
    • Champion of Loops


    Hi and Thanks for your feedback on this.

    I think I might have something to help :

    pop over to here:

    Fill out the form (see screenshot) and grab the code.

    Then go to your Floating Social settings page:

    Admin --> Settings --> Floating Social


    And then add it as a new service (see Screenshot)

    There are a couple more handy notes in there as well :slight_smile:

    Hope this helps!



    If this thread is not resolved because the suggested action did not work or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

  • woodenfox
    • WPMU DEV Initiate

    This does not solve the problem.

    The Pinterest JS is not smart enough to fetch the image automatically for the page. This is why an image must be specified within the code like this:

    <a href="">Pin It</a>
    <script type="text/javascript" src=""></script>

    Floating Social appears on all of the pages of my site. That is 1000+ pages. This is why I need to insert PHP into the floating social "Custom Service Code" box. This allows me to fetch the image for every page and put it into the field Pinterest requires.

    This is very easy to fix. Simply allow Wordpress PHP inside the "Custom Service Code" box. This is the code I would like to include in the "Custom Service Code" box:

    <a href="<?php the_permalink() ?>&media=<?php echo pinterest_image() ?>&description=<?php the_title(); ?> on <?php bloginfo('url'); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>
    <script type="text/javascript" src=""></script>

    When I do this now, I get something that looks like this:

  • Vladislav
    • Dead Eye Dev


    Seeing the sheer number of requests, adding Pinterest button will definitely be one of the priorities for Floating Social update. While adding arbitrary PHP execution support is possible, I must say, I'm reluctant to actually do it as it's pretty much an accident waiting to happen, especially on network installs. Perhaps some sort of macro replacement would be a better choice for this kind of situation?

    In the meanwhile, I believe that Pinterest should be able to recognize a subset of OpenGraph tags - at least, og:image should be supported. Is perhaps this something you can use?

  • woodenfox
    • WPMU DEV Initiate

    Thank you very much @VeBailovity

    You right about the dangers of PHP execution across a network. Currently the async Pinterest does not recognize OG tags. Looks like we'll just wait for you to release your next update to resolve the issue.

  • Vladislav
    • Dead Eye Dev


    The latest plugin release (v1.5, just released) includes a Pinterest service. The new service will automatically use your post featured image for sharing on Pinterest. If it can't find the featured image to share, the default behavior is to not show the sharing button. Also, both of these behaviors can be relatively easily modified through hooks. If you're comfortable with PHP, I'll include some quick examples here.

    For an example, this will force the Pin button to show, no matter what:

    function fshf_show_pinterest ($show, $atts) {
    	return true;
    add_filter('wdsb-buttons-pinterest', 'fshf_show_pinterest', 10, 2);

    The "wdsb-buttons-pinterest" filter takes 2 arguments - should the button be shown ($show) and an array of button features ($atts). The filter should return a boolean true or false - true meaning the button will be shown.

    This example will force all Pin buttons to share a Hello Kitty image from Wikipedia:

    function fshf_show_image ($image, $size) {
    	return '';
    add_filter('wdsb-media-image', 'fshf_show_image', 10, 2);

    The "wdsb-media-image" filter also takes 2 arguments - the image found by the plugin (if any), and the size that was being looked for. The filter handling funciton is expected to return a string, which is the full URL to the image you want to be shared.

    There are some other filters you may want to use to modify the plugin behavior as well - if you wish, you can find them in the file lib/functions.php in the plugin directory.

  • bhusema
    • WPMU DEV Initiate

    Oh my God. I've been banging my head against the screen relearning php for a ridculously long time working on this, and finally came up with something just in time to discover the new release came out 13 hours ago. Learning experience. Good thing I saw this before I uploaded my pathetic display of an attempt to code. Thanks Devs!

  • Vladislav
    • Dead Eye Dev


    The reason the Pinterest button is not showing is most likely because the plugin didn't found an image for your post. By default, the plugin will look for the featured image for your post, and use that as Pinterest image. If this lookup fails, the plugin will just skip showing the Pinterest button, by default. The solution for this situation could be as easy as adding a featured image to your post. However, there are also some more advanced techniques of dealing with this situation, if the easy solution doesn't fit your scenario.

  • aecnu
    • WP Unicorn


    Just checking if this issue was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that's great news.

    If not, or you have any more questions related to this thread, please feel free to post them below including any new symptoms or errors and tick the 'Mark as Not Resolved (re-open)' box below the post area (or else we'll miss it!)

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thank you all for being WPMU Dev Members!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.