Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
twitter card plugin
Twitter has made a card plugin available for Wordpress
From what I’ve seen of this, I deduce that all the plugin does is insert twitter tags into the body of articles. I’ve been trying to do that manually at my site but can’t quite get it to work. It’s half working – Twitter finds the tags but is not inserting an excerpt or image.
Is anyone aware of this Twitter feature, knows how to implement it, or even interested in building a TXP plugin or modifting the WP one?
- or any other useful advice!
Offline
Re: twitter card plugin
In case of Textpattern such widget plugin isn’t necessary, in fact not really even wise to do one. To implement a Twitter card on your website, you don’t need to do anything else than add few meta
tags inside your head
element. You can populate the meta tags with anything you want, using tags such as images, custom_field and so-on to your advantage. Like for instance:
<txp:if_individual_article>
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@yoursitetwitterusername" />
<meta name="twitter:title" content="<txp:title />" />
<meta name="twitter:description" content="<txp:custom_field name="description" />" />
<meta name="twitter:url" content="<txp:permlink />" />
<txp:if_article_image>
<txp:images limit="1">
<meta name="twitter:image" content="<txp:image_url />" />
</txp:images>
</txp:if_article_image>
</txp:if_individual_article>
See Twitter Card documentation for all available options, and you may use their validator to verify your implementation.
Offline
Re: twitter card plugin
…and otherwise, arc_social_share and pat_article_social support twitter cards.
Edit: arc_social_share should be used with arc_meta for meta tags. <txp:arc_meta_twitter_card />
is your friend.
Last edited by NicolasGraph (2015-04-01 15:46:30)
Offline
Re: twitter card plugin
OK thanks. I tried inserting those tags in the header and its not working. That seems to be the simplest way of doing it. I tried leaving in the <txp:if_individual tags and leaving them out – concerned Twitter might not work with them.
I’ll play around with those plugins and see if they work.
UPDATE: I’ve got the plugin solution working – almost.
There’s some odd behaviour however at Twitter. When you click “view summary” the card should open below. It doesn’t – the click takes you to the individual tweet, away from the Twitter front page.
I’ve no idea if that’s a txp plugin issue or an issue with the Twitter web site.
Last edited by jameslomax (2015-04-01 17:15:52)
Offline
Offline
Offline
Offline
Re: twitter card plugin
That’s strange – I’ve never seen that before except with my new card. I’ve been using Twitter extensively for 2 years.
Is it the same if you go to twitter.com and click ‘view summary’ for a tweet on the home page?
- because if I do that now the summary expands and I stay on that page. if I want it to close I see ‘Hide Summary’
Last edited by jameslomax (2015-04-01 18:02:38)
Offline
Offline
Re: twitter card plugin
You referred to ‘view summary’ tweets at the channels of Le Monde and Etapes.
Strangely – I saw the same as you. Click ‘view summary’ and you go to another page where you find the tweet.
However – if I go to twitter.com and click ‘view summary’ on any random tweet it behaves as it should: the summary expands and you stay on that page.
- it seems odd, I don’t know why that’s happening, but it is (for me).
Last edited by jameslomax (2015-04-01 19:01:50)
Offline
Re: twitter card plugin
jameslomax wrote #289655:
However – if I go to twitter.com and click ‘view summary’ on any random tweet it behaves as it should: the summary expands and you stay on that page.
What do you mean by twitter.com? The twitter homepage is a login page. Do you mean on your account page?
If it’s what you mean, it’s the same for me…
Last edited by NicolasGraph (2015-04-01 18:19:14)
Offline
Re: twitter card plugin
No – I mean the home page where you see all you the channel tweets you follow.
UPDATE: OK I think I understand. if you click ‘view summary’ on the front page twitter.com the summary expands. if you click ‘view summary’ on a tweet at a channel – you go to another page.
That seems to be how Twitter works. I never noticed.
Offline