Skip to content

Instantly share code, notes, and snippets.

@caefer
Created August 17, 2014 16:33
Show Gist options
  • Save caefer/e710f189ebb6b76a9dee to your computer and use it in GitHub Desktop.
Save caefer/e710f189ebb6b76a9dee to your computer and use it in GitHub Desktop.
<?php
function twitter_card_info()
{
$twitter_excerpt = get_the_excerpt();
if (!$twitter_excerpt) $twitter_excerpt = get_bloginfo('description');
// ..
echo '<meta name="twitter:description" value="'.$twitter_excerpt.'" />';
}
add_action('wp_head','twitter_card_info');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment