解析错误:语法错误,意外T_STRING

时间:2013-05-19 02:16:05

标签: php wordpress syntax-error

将短代码插入我构建的Wordpress主题后,我收到以下错误:

  

解析错误:语法错误,意外的T_STRING   /home/content/70/11104970/html/wp-content/themes/theme/cait.php on   第11行

有问题的代码:

<div class="vlog-stream">
        <?php echo do_shortcode('[ix_show_latest_yt ytid='caitbarker' width='280' height='170' autoplay='off' count_of_videos='1']'); ?>
        <p>vlog</p>
    </div><!-- end vlog-stream -->

可以找到整个文件here

如果我过去收到此错误,则是由于需要额外的空格或使用"而不是'。我已经检查并纠正了这两件事,但问题仍然存在。

1 个答案:

答案 0 :(得分:1)

确实你的问题似乎是引用。您需要正确地转义它们或使用双引号和单引号的组合:

<?php echo do_shortcode("[ix_show_latest_yt ytid='caitbarker' width='280' height='170' autoplay='off' count_of_videos='1']"); ?>

一个提示是查看语法高亮,看看它与你的问题相比现在看起来是否正确?

相关问题