• maryannk

    (@maryannkelley)


    I just started using the plugin and this may be obvious but I can’t seem to figure it out. I have a pin image in the post, but the share button is picking up the first image in the post (which is also the featured image) to pin (sq instead of portrait). Short of using the no-pin attribute in all of the other images, how can I get it to offer a choice or pin the correct image?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    I see that you have an image labeled for Pinterest in your post content. Did you add it to the post as well using the “Select Pinterest Image” button (in the Document panel, down towards the bottom)? That is what the plugin uses to select an image other than the featured image.

    Because this plugin does not use JavaScript, it will not offer a choice of images, unless your users have their own browser addon for Pinterest installed. It will only offer the specific Pinterest image if you set it, or the featured image if no Pinterest image is set.

    Thread Starter maryannk

    (@maryannkelley)

    Thanks for the quick reply, Robin. I didn’t, and I should have realized that. I have always used Tasty Pins for that and did not realize that I would have to go back and specify a pin image in Scriptless Social Sharing for every post on the site. Is there any way I could add a function to have the plugin pull whatever pin(s) are in Tasty Pins? If it’s a possibility but beyond the free support offered, I would consider commissioning it. It would save a lot of time for me and/or my VA.

    Plugin Author Robin Cornett

    (@littlerchicken)

    The plugin Pinterest image is just an ID saved to the post meta, so you can use a standard WordPress filter to look for a fallback image if the Pinterest image is not set. Something like this would be where I would start:

    
    add_filter( 'get_post_metadata', 'prefix_get_pinterest_fallback', 10, 3 );
    /**
     * If a pinterest image is not selected, look for a fallback image ID.
     *
     * @param mixed $value
     * @param int $post_id
     * @param string $meta_key
     * @param boolean $single
     * @return mixed
     */
    function prefix_get_pinterest_fallback( $value, $post_id, $meta_key ) {
    	if ( '_scriptlesssocialsharing_pinterest' !== $meta_key ) {
    		return $value;
    	}
    	if ( $value ) {
    		return $value;
    	}
    
    	// Replace tasty_pins_meta_key with the actual key for the tasty pins image.
    	return get_post_meta( $post_id, 'tasty_pins_meta_key', true );
    }
    

    I don’t know what meta key Tasty Pins uses for a Pinterest image, but once you know that, replace tasty_pins_meta_keywith what the actual meta key is. This code will use the Pinterest image if you’ve set it, so for new posts, go ahead and set it, and then if one is not set, it will look for the other image and use that, if it’s set. Hope that helps you get started–

    Thread Starter maryannk

    (@maryannkelley)

    Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wrong image being pinned’ is closed to new replies.