raamdev / independent-publisher

A beautiful reader-focused WordPress theme, for you.
http://independentpublisher.me
GNU General Public License v3.0
460 stars 107 forks source link

Header image in social media post #266

Closed MGravemade closed 7 years ago

MGravemade commented 7 years ago

I have set my header image with the option: Appearance -> Header

Now, when I refer to my website on social media, I don't get the header image in my social media post.

When I set the header image through the Pages -> Edit -> Featured image option, then this works fine, but I don't want to use this option.

Is this a bug?

raamdev commented 7 years ago

Can you give me some example URLs and let me know which social media network you're seeing this issue with?

chrisaldrich commented 7 years ago

This sounds more like an OGP problem relating to a social and/or SEO plugin (Yoast or All in One perhaps). Does Independent Publisher set meta tags with open graph protocol? I don't imagine it does.

If you view the source of the page (that does show the featured image in social media) you'll usually see something like the following in the header of the page: <meta property="og:image" content="http://example.com/wp-content/uploads/photo_path.jpg"&gt; This is the meta tag the social platform is likely pulling the image from.

It's possible that it's the case that the SEO/other plugin is automatically pulling the photo from the theme in one case but not the other. These plugins typically have settings to allow overriding the featured photo, using a default photo if one isn't specified, or not using one at all.

This sounds to me more like an issue with another plugin causing the problem and not the theme.

MGravemade commented 7 years ago

This problem happens on Facebook and LinkedIn.

I did some further testing.

The og:image tag is showing the last image in the page. For example I have added a test page with a test image just in the text field and then the meta tag is showing:

Test page: https://connect2convert.nl/test/

On my other pages the social media icons are the last images...

MGravemade commented 7 years ago

The meta tag was missing in my comment:

property="og:image" content="https://connect2convert.files.wordpress.com/2017/03/7048c292b0ee4891b6aa473b31b9d7b8-e1492496158324.jpg" />

raamdev commented 7 years ago

@MGravemade You're using Independent Publisher on WordPress.com. That's not the same as the Independent Publisher hosted here on GitHub, which is for the self-hosted (WordPress.org) version of WordPress. Please see http://independentpublisher.me/2016/getting-support-for-independent-publisher-on-wordpress-com/