Author Topic: Anyone got twitter Card Validator working?  (Read 529 times)

Offline DreadPirateRoberts

  • Semi-Newbie
  • *
  • Posts: 39
    • Agora Road's Macintosh Caf
Anyone got twitter Card Validator working?
« on: May 16, 2020, 01:49:46 PM »
Im wonder what to put inot the code so an image will show up when I put in twitter card validator to work. So far I know that this code works when I put into the header tags in index. template

Code: [Select]
<meta name="twitter:card" content="summary_large_image">but I dont know what to put here so that twitter will take the BBc image on the first post to work? and also the title

Code: [Select]
<meta name="twitter:title" content="">
<meta name="twitter:image" content="">

Can someone help me?

Welcome to Agora Road's Macintosh Cafe || A retro design vaporwave community forum! Enjoy your stay!

Offline drewactual

  • Sr. Member
  • ****
  • Posts: 915
    • College Football Fan Site CFB51
Re: Anyone got twitter Card Validator working?
« Reply #1 on: May 17, 2020, 05:11:43 PM »
goes like this:

<meta property="og:url" content="your web address here" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="title of your page here" />
    <meta property="og:description" content="a little longer description here" />
    <meta property="og:image" content="address to image here, preferably in .png and proper size" />
    <meta name="twitter:card" content="summary" /> <!-- literally JUST the word summary, tells twitter what it is -->
    <meta name="twitter:site" content="@your twitter account name" />
    <meta name="twitter:title" content="site's title just like above in og:title" />
    <meta name="twitter:description" content="again like the OG description" />
    <meta name="twitter:image" content="address to the image you want twitter to use, can be same as og:image if you wish" />

you COULD use a php script to pull the first image and offer it up to twitter- but- twitter is known to cache these things and that may cause you issues... i find it better to use a static image.  if you want you can have a conditional script to offer different cards for different boards, which is something i do- but those are static too.

if you're relying on social media to drive traffic i highly rec you get the open graph and the cards right... along with prettyURL's, this impacts users who are more likely to engage when they can see a 'taste' of what they'll find on your page.  i know that is debatable to many here, but it's worked for me on several sites.