Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development The WordPress Loop Adding the Loop to the index.php File

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

Getting unexpected end of file error on line 27 of this code.

I'm getting this error.

Parse error: syntax error, unexpected end of file in /Users/jeff/Documents/Websites/www.sandbox.dev/wp-content/themes/treehouse-portfolio/index.php on line 27

for this code:

<?php get_header(); ?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

<section class="row"> <div class="small-12 columns text-center"> <div class="leader">

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

      <h1><?php the_title(); ?></h1>
      <p><?php the_content(); ?></p>

    <?php endwhile; else : ?>

        <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>

    <?php endif; ?>    

    </div>
  </div>

</section>

<?php get_footer(); ?>

2 Answers

Jeffrey Cunningham
Jeffrey Cunningham
5,592 Points

Never mind, I got the answer. But could someone tell me how to properly insert code into these text boxes. My question above left the whole section of code out where the error occurred.

George Boyd
George Boyd
1,402 Points

Jeffrey, could you share your answer?