Twitter card share button
Asked Answered
T

4

12

I have issues with Twitter share button, I have this code as an input:

<meta name="twitter:card"        content="summary">
<meta name="twitter:site"        content="@citydesigning">
<meta name="twitter:title"       content="City Design">
<meta name="twitter:description" content="I recommend this epic City Design online course at https://stepic.org/city #stepiccity">
<meta name="twitter:creator"     content="citydesigning">
<meta name="twitter:image:src"   content="https://stepic.org/static/classic/city/images/sharepic.png">

and

<a class="twitter" 
   href="https://twitter.com/intent/tweet?url=https://stepic.org/city" 
   target="_blank"></a>

But it returns no results when sharing, only this text: "https://stepic.org/city" instead of all Twitter card information (like image and some text) when clicking "View summary" on Twitter's feed.

Can you help me, pleasee?

Transportation answered 31/1, 2014 at 11:23 Comment(1)
I have the same exact problem. Have you ever figured out what the problem is?Cindacindee
C
10

Domains need to be approved before Twitter Cards will work. Use Twitter's validator and then click "request approval":

https://cards-dev.twitter.com/validator

Conney answered 5/2, 2014 at 1:0 Comment(8)
How long will it take to work after it has been approved? My website was approved 2 weeks ago and whenever I share a link of it, no card is shown, plan text link only.Actinomycosis
I'm having the same problem. The card looks perfect in the twitter validator, but the "Share a link with your followers" only contains the text and url with no card attached.Kapp
same problem here. Was solution found?Into
I also have to ask if you found a solution?Alpha
Also jumping in on this - our domain is whitelisted for a summary card. I can't get anything other than the url to "Tweet". No card.Brilliantine
Same problem here. Did any one of you found the solution. @CojonesDemeanor
It actually started working a few weeks after I approved my website.Actinomycosis
Yes @Cojones its working now. The problem was the port number in the URL which I was using earlier (due to which it was not getting validated at twitter website) then I replace it with only domain name and it worked. For others always give the URL in tweet-intent where your twitter meta tag is defined.And once the tweet is posted look for 'view summary' below tweet text.Demeanor
J
7
  1. Validate your twitter card via https://cards-dev.twitter.com/validator

  2. HTML code is :

    <a href="http://www.twitter.com/intent/tweet?url=http://your-url&text=caption">tweet</a>
    

    You will only see caption text and url. but, when you share via click tweet button, you will see summary card, your profil page.

Jefferson answered 20/1, 2017 at 22:17 Comment(1)
Answer here for me was including the url BEFORE the text. That made it work.Placative
H
1

In-order to display the image, replace:

<meta name="twitter:card" content="summary">

with:

<meta name="twitter:card" content="summary_large_image">

and also check whether the twitter crawler is able to access it properly by entering the url to https://cards-dev.twitter.com/validator

Hirst answered 14/9, 2015 at 11:17 Comment(0)
R
0

This is actually the expected behaviour. Twitter cards do not show up in the Tweet share dialog but when you click the tweet button in your share dialog, it will be displayed on twitter as a card. https://twittercommunity.com/t/card-validator-is-working-but-website-share-show-different-content/36092/2

Racer answered 2/7, 2017 at 2:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.