Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

After inserting shortcode into a Wordpress theme I'm building, I received the following error:

Parse error: syntax error, unexpected T_STRING in /home/content/70/11104970/html/wp-content/themes/theme/cait.php on line 11

The bit of code in question:

<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 -->

The entire file can be found here.

When I've received this error in the past, it was a result of either extra spaces or the use of " instead of '. I've checked and corrected both of these things and still the problem persists.

share|improve this question

closed as too localized by Jocelyn, PeeHaa, tereško, hakre, Benjamin Gruenbaum May 21 '13 at 0:44

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 1 down vote accepted

Indeed you problem seems to be the quotes. You need to escape them properly or use a combination of double quotes and single quotes:

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

A tip is to look at the syntax highlighting, see how it now looks correct compared to your question?

share|improve this answer
    
Thank you for spotting this. For some reason, I thought " wasn't allowed at all, but indeed I was incorrect. – AMC May 19 '13 at 2:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.