Having your tweet and embedding it, too

One of things that WordPress has been doing well for years now is embedding tweets (and other media) automagically: You simply copy the URL, and WordPress will convert it into a handsomely formatted tweet. A number of plug-ins developed for that purpose have become obsolete for the same reason, but there are problems for anyone who writes posts (or tweets) not intended to be immediately disposable: If Twitter changes its API or, as also occurs, a quoted tweep’s account disappears, the embedded content may disappear along with it.

It’s easy, as I just discovered today, to have your tweet and embed it, too, and in a way that should, as we say, “degrade gracefully.” Automating this process in the form of a plug-in would not be terribly difficult, though I’m not sure how many WordPressers care enough about their posts or the tweets they embed in them to use it.

Until such time as a “keep tweet-text” plug-in is developed or the capacity is made part of WordPress core functionality (don’t hold your breath), you can use the following 4-step procedure.

1. Embed the tweet as you normally would

Copy the tweet URL, and place it on its own line in the Visual or Text editor, save the files as a draft, and preview it.

2. View Page Source

On Firefox, that means right-clicking on the rendered (previewed) post, and choosing View Page Source from the contextual menu.

3. Search for “twitter-tweet” in the Page Source window

That’s the CSS class that WordPress adds to the automagic embed. You will find code that looks something like the following  in your “post-entry” div:

4. Copy-paste the lines from the first <blockquote to the last /p> into the text editing pane – and save.

I’m using the tweet that I was reading when I stumbled upon this method. The above will get you the following render, which will be identical to the tweet auto-embedded by its URL alone:

Which, through the magic of twitter’s Javascript, is the same pretty, functional dealybob that the auto-embed gets you, with the difference being that, in the event the tweet or tweep disappears from Twitter, or for that matter in the even that Twitter goes down – or if you’re exporting the post to a different format or platform – you’ll still have the content you were using, converted into a simple blockquote:

For the purposes of illustration, I’ve changed the tweet (or “status” in Twitter nomenclature) to a non-existent one. If you click on the link, it will take you to a “sorry, that page doesn’t exist” page.

(Note usual cautions about Text vs Visual editor on WordPress: If you return to the Visual Editor, you may lose the key line that calls the Twitter script at the end – meaning that you should do this step last, and be careful when returning to the post at a later time.)


WordPresser
Home Page  Public Email  Twitter  Facebook  YouTube  Github   

Writing since ancient times, blogging, e-commercing, and site installing-designing-maintaining since 2001; WordPress theme and plugin configuring and developing since 2004 or so; a lifelong freelancer, not associated nor to be associated with any company, publication, party, university, church, or other institution.

Commenter Ignore Button by CK's Plug-Ins

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Related

Noted & Quoted

TV pundits and op-ed writers of every major newspaper epitomize how the Democratic establishment has already reached a consensus: the 2020 nominee must be a centrist, a Joe Biden, Cory Booker or Kamala Harris–type, preferably. They say that Joe Biden should "run because [his] populist image fits the Democrats’ most successful political strategy of the past generation" (David Leonhardt, New York Times), and though Biden "would be far from an ideal president," he "looks most like the person who could beat Trump" (David Ignatius, Washington Post). Likewise, the same elite pundit class is working overtime to torpedo left-Democratic candidates like Sanders.

For someone who was not acquainted with Piketty's paper, the argument for a centrist Democrat might sound compelling. If the country has tilted to the right, should we elect a candidate closer to the middle than the fringe? If the electorate resembles a left-to-right line, and each voter has a bracketed range of acceptability in which they vote, this would make perfect sense. The only problem is that it doesn't work like that, as Piketty shows.

The reason is that nominating centrist Democrats who don't speak to class issues will result in a great swathe of voters simply not voting. Conversely, right-wing candidates who speak to class issues, but who do so by harnessing a false consciousness — i.e. blaming immigrants and minorities for capitalism's ills, rather than capitalists — will win those same voters who would have voted for a more class-conscious left candidate. Piketty calls this a "bifurcated" voting situation, meaning many voters will connect either with far-right xenophobic nationalists or left-egalitarian internationalists, but perhaps nothing in-between.

Comment →

Understanding Trump’s charisma offers important clues to understanding the problems that the Democrats need to address. Most important, the Democratic candidate must convey a sense that he or she will fulfil the promise of 2008: not piecemeal reform but a genuine, full-scale change in America’s way of thinking. It’s also crucial to recognise that, like Britain, America is at a turning point and must go in one direction or another. Finally, the candidate must speak to Americans’ sense of self-respect linked to social justice and inclusion. While Weber’s analysis of charisma arose from the German situation, it has special relevance to the United States of America, the first mass democracy, whose Constitution invented the institution of the presidency as a recognition of the indispensable role that unique individuals play in history.

Comment →

[E]ven Fox didn’t tout Bartiromo’s big scoops on Trump’s legislative agenda, because 10 months into the Trump presidency, nobody is so foolish as to believe that him saying, “We’re doing a big infrastructure bill,” means that the Trump administration is, in fact, doing a big infrastructure bill. The president just mouths off at turns ignorantly and dishonestly, and nobody pays much attention to it unless he says something unusually inflammatory.On some level, it’s a little bit funny. On another level, Puerto Rico is still languishing in the dark without power (and in many cases without safe drinking water) with no end in sight. Trump is less popular at this point in his administration than any previous president despite a generally benign economic climate, and shows no sign of changing course. Perhaps it will all work out for the best, and someday we’ll look back and chuckle about the time when we had a president who didn’t know anything about anything that was happening and could never be counted on to make coherent, factual statements on any subject. But traditionally, we haven’t elected presidents like that — for what have always seemed like pretty good reasons — and the risks of compounding disaster are still very much out there.

Comment →
CK's WP Plugins

Categories

Extraordinary Comments

CK's WP Plugins