Unable to render Card preview


#1

Hi
I have a wordpress site with normal twitter share links with a theme, but I had problems for to share links with images in Twitter while Facebook and other Social links was sharing normally. For recomendation of the template I installed YOAST SEO for to get card share. Yesterday I could share some articles with images and some don’t. But I changed some folders permissions (755 for folders and 644 for files, all normal), and now I can’t share no one image.
For to configurate YOAST I add in header.php, before tag the following code:

<?php
#twitter cards hack
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://www.gravatar.com/avatar/8eb9ee80d39f13cbbad56da88ef3a6ee?rating=PG&size=75';}
$twitter_name   = str_replace('@', '', get_the_author_meta('twitter'));
?>
<meta name="twitter:card" value="summary" />
<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="@libdemvoice" />
<?
  if($twitter_name) { ?>
<meta name="twitter:creator" value="@<?php echo $twitter_name; ?>" />
<?
}
}
?>

But in Card validator the result is “Unable to render Card preview”

Then I have two doubts, one with the correct code and two with folder permissions. I think this could be affect something.
I’m not a good web developer, please explain me for dummies.

Thanks!


#2

We’re not able to help without a URL to check. Did you check the troubleshooting post?