How to Add Twitter Cards to Your Blog

Twitter Card Instructions

*warning* I have not yet had the time to go through and actually test these instructions. If you give it a go, it's on you. The original instructions are below. I did manage to get them to work though.

If you use the default settings for blogger, and you share it on Twitter, it will come out like this:



But if you would prefer a more user-friendly, better looking post like this:



Just follow these 7 easy steps (you can click on the images to enlarge them):

1. Open your blog

2. Hit the ‘Theme’ button

 

3. Hit the ‘Edit HTML’ button



4. Click anywhere inside the Template code, then search for ‘<head>’ ( CTRL+F ) :




5. Insert the following code right underneath ‘<head>’...keep these variables in mind. You will need to change them. [I have the code in text below the image so you can copy and paste it]

 

Here's the code:

<meta content='summary_large_image' name='twitter:card'/>
<meta content='@your-name' name='twitter:site'/>
<b:switch var='data:blog.pageType'>
<b:case value='index'/>
<meta expr:content='data:blog.pageTitle' name='twitter:title'/>
<b:default/>
<meta expr:content='data:blog.pageName' name='twitter:title'/>
</b:switch>
<b:if cond='data:blog.metaDescription != &quot;&quot;'>
<meta expr:content='data:blog.metaDescription' name='twitter:description'/>
</b:if>
<meta content='@your-name' name='twitter:creator'/>
<b:switch var='data:blog.pageType'>
<b:case value='item'/>
<meta expr:content='data:blog.postImageUrl' name='twitter:image'/>
<b:default/>
<meta content='img-url-for-home-page' name='twitter:image'/>
</b:switch>


6. Hit ‘Ctrl + F’ and find ‘your-name’. Replace it with your own blog title. It should now look like this:



7. Hit the ‘Save Theme’ button. You're done. Hit the ‘Back’ button, view your blog and see if it works.

You may get an error message (I did) but it seems to work anyways.

If you would like to see the original help page I followed, you can find it here:

https://www.howbloggerz.com/2016/02/how-to-add-twitter-cards-meta-tags-to-blogger.html

Go straight down to ‘Option 2’...but you’ll find as I did that the layout is out-of-date.

Good luck!

No comments:

Post a Comment

The Language of Drug Pushers and Pimps

Misleading medical professionals and profiting from the import of dangerous drugs into the state, the pharmaceutical industry has a lot to a...