I am trying to share the tweet using twitter share button and using twitter cards for post image with my link and i am using :
<meta property="og:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg">
<meta property="og:title" content="SOME TEXT">
<meta property="og:description"SOME DESCRIPTION">
<meta name="twitter:site" content="THIS IS CONTENT">
<meta name="twitter:card" content="photo" />
<meta name="twitter:title" content="TWITTER CONTENT">
<meta name="twitter:description" content="TWITTER DESCRIPTION">
<meta name="twitter:image" content="https://farm6.staticflickr.com/5510/14338202952_93595258ff_z.jpg">
and for share button using this:
<a class="twitter-share-button"href="https://twitter.com/intent/tweet?text=Hello%20world">Tweet</a>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
but this code only sharing text and link on twitter not with image.
can any one tell me whats wrong with my code?
My Card does not appear in the timeline.Twitter Cards generated from developer meta tags only appear when a Tweet is either expanded in the timeline (on web) or viewed on the Tweet's individual permalink page (by clicking on the date from the timeline, either on web or on mobile).
With Twitter Cards, you can attach rich photos, videos and media experiences to Tweets, helping to drive traffic to your website. Simply add a few lines of markup to your webpage, and users who Tweet links to your content will have a “Card” added to the Tweet that's visible to their followers.
Typically if the link's website has Twitter Cards enabled a preview should display. To verify if the site you are linking to has a Twitter Card, and to see what it will look like, enter the link into Twitter's Card validator. Learn more about Twitter Cards, and how to add them to your website.
I just solved this issue by changing the tag name:
<meta name="twitter:image:src" content="https://example.com/img/my_image.jpg">
It seems the documentation is showing twitter:image
instead of twitter:image:src
.
First, try to use complete path from http or https for example: https://webpage.com/my_path_image.jpg
Check directly in the following links:
Twitter: https://cards-dev.twitter.com/validator
Facebook: https://developers.facebook.com/tools/debug/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With