[SOLVED] ERROR: Required meta tag missing (twitter:description)


#1

Hi

I having trouble with the Card Validator;
ERROR: Required meta tag missing (twitter:description)

Header:

    <?php
#twitter cards
if(is_single() || is_page()) {
  $twitter_url    = get_permalink();
 $twitter_title  = get_the_title();
 $twitter_desc   = get_the_excerpt();
   $twitter_thumbs = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), full );
    $twitter_thumb  = $twitter_thumbs[0];
      if(!$twitter_thumb) {
      $twitter_thumb = 'http://img4.hostingpics.net/pics/468218favicon.png';
    }
  $twitter_name   = str_replace('@', '', get_the_author_meta('twitter'));
?>
<meta name="twitter:card" value="summary_large_image" />
<meta name="twitter:url" value="<?php echo $twitter_url; ?>" />
<meta name="twitter:title" value="<?php echo $twitter_title; ?>" />
<meta name="twitter:description" value="<?php echo $twitter_desc; ?>" />
<meta name="twitter:image" value="<?php echo $twitter_thumb; ?>" />
<meta name="twitter:site" value="@TodayviewTweet" />
<?
  if($twitter_name) {
?>
<meta name="twitter:creator" value="@<?php echo $twitter_name; ?>" />
<?
  }
}
?>

I can’t see what’s wrong

PS: I’m on Wordpress with Griffin theme using the following in fonction.php:

// custom excerpt 
function new_excerpt_more($more) {
	global $post;
	return '... <p><a class="teaser-more" href="'. get_permalink($post->ID) . '">' . 'Read more' . '</a></p>';
}
add_filter('excerpt_more', 'new_excerpt_more');

Website http://todayview.ovh/

Thanks for your support


#2

For some reason the twitter:description value is not being populated in your post pages.

I guess this means that your blog entry is not getting an excerpt value written into it. I’m afraid we really cannot help you to debug Wordpress or PHP issues. If you can find our why your code isn’t populating that value, and you still have issues validating your cards, we can take a look at those.

Good luck!


#3

I finaly changed the get_the_excerpt to new_excerpt_more that was the custom entry Thanks for the replies