Twitter卡现在用PHP脚本吗?

时间:2015-05-05 14:37:43

标签: php twitter-card

更新

<?PHP
    $Title = "This is the Open Grah script";
    $Description = "This is the one and only Description, or better yeh the first 150 charecters of the main content on your page. What ever you feel like really!";
    $Twitter = "@obama";

     echo "<html>
            <head>
             <title> $Title </title>";
     echo '<meta name="description" content=" ';
     echo $Description;
     echo '" />';

     echo "<meta name="twitter:card" content="summary" />";  
     echo '<meta name="twitter:site" content"';
     echo $Twitter
     echo '"/>';
     echo '<meta name="twitter:title" content"';
     echo $Title;
     echo '" />';
     echo '<meta name="twitter:description" content" ';
     echo $Description;
     echo '" />';

    ?>

跟进我的上一个问题,我的页面已经不再负载了,如果您觉得我在浪费时间,我很抱歉。这可能只是一个错字。

1 个答案:

答案 0 :(得分:3)

 echo "<meta name='twitter:card' content='summary' />";  

您需要确保在"开头的字符串中没有使用"。您应该在以'开头的字符串中使用\""

之后两行你错过;

echo $Twitter;