Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress WordPress Theme Development Custom Post Type Templates in WordPress The Portfolio Single Page

Don Shipley
Don Shipley
19,488 Points

Parse error: syntax error, unexpected '(', expecting ';' single-portfolio.php on line 25

'<?php get_header(); ?>

<section class="two-column row no-max pad"> <div class="small-12 columns"> <div class="row"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <!-- Primary Column --> <div class="small-12 medium-7 medium-offset-1 medium-push-4 columns"> <div class="primary">

  <?php the_field('images'); ?>

 </div>

</div>

<!-- Secondary Column --> <div class="small-12 medium-4 medium-pull-8 columns"> <div class="secondary">

        <h1><?php the_title(); ?></h1>
        <p><?php the_field('description'); ?></p>

    </div>
</div>
           <?php endwhile(); endif; ?>
          </div>
         </section>

<?php get_footer(); ?>'

3 Answers

Erik McClintock
Erik McClintock
45,783 Points

Don,

Near the bottom of your code, when you call "endwhile;", you have added extraneous parenthesis.

You have:

<?php endwhile(); endif; ?>

You want:

<?php endwhile; endif; ?>

Erik

Paul Roberts
Paul Roberts
7,928 Points

Don is correct. Zac does actually write: endwhile(); in the video. So thanks for clearing that up!

Much appreciated.

Don Shipley
Don Shipley
19,488 Points

Thank you. I added them for they are on the video..

Henry Reyes
Henry Reyes
376 Points

I also had the same error. Zac wrote it wrong and later on the video it seems like him fixed it however never pointed that out!

Too bad. So many errors.