What is the meta tag if you want use "if" & "else"... if unable to render "photo" then use "summary"?


#1

What is the meta code if unable to render “photo” card then use instead “summary”?

If unable to render a valid photo for
<meta content='photo' name='twitter:card'>
then grab the thumbnail for summary
<meta content='summary' name='twitter:card'>

Some of my posts have or will have a valid photo for the “photo” card and some posts have or still have the need for the “summary” card.


#2

Multiple card types per page are not supported, so you will need to choose which card to use for your page.

Perhaps you can do something conditional on the server side in PHP or whatever language your site is using, to decide what kind of card is appropriate for the post and render the right meta tags in the page?