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

I pretty much copied this code word for word from a tutorial. I'm not sure what is wrong. I searched the error message and it seems like something isn't closed correctly? But like I said I tripled check and this is how it was written in the tutorial?

What could Parse error: syntax error, unexpected $end in __ in line 44 mean?? Line 44 is the last line

<?php /* Template Name: template */ ?>
<?php get_header(); ?>

<?php get_sidebar(); ?>





            <div id="sidebar1" class="scolumn fix" style="width:326px;">
                <div class="scolumn-pad">
                    <?php pagelines_template_area('pagelines_sidebar1', 'sidebar1'); ?>
                </div>
            </div>


        <div style="width:560px; float:left; margin-top:50px;" >

                <?php query_posts('category_name=template-category');?>
                 <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>


                 <div style="float:inherit; padding-bottom:10px;"> 

                    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
                     <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>

                    <span>
                        <a href="<?php the_permalink() ?>" target="_blank">
                            <?php the_post_thumbnail('thumbnail'); ?>
                        </a>

                    </span>
                    <!-- Content -->
                        <?php the_excerpt(); ?>
                    </div>

                     <?php endwhile; ?>
        </div>
<?php get_footer(); ?>
share|improve this question

closed as off-topic by Gordon Feb 22 '14 at 9:49

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – Gordon
If this question can be reworded to fit the rules in the help center, please edit the question.

    
It probably means there is no line 44. – l'L'l Feb 22 '14 at 9:48
    
??. Elaboration? I deleted all blank lines. So line 44 is <?php get_footer(); ?>. I also deleted <?php get_footer(); ?> so that </div> is the last line. Still get the error. – user2559519 Feb 22 '14 at 9:48
    
In your code above there are only 39 lines. – l'L'l Feb 22 '14 at 9:49
    
Thanks, but CornelB's solution worked for me. – user2559519 Feb 22 '14 at 9:54
    
Alternatively remove colon after if -> if ( have_posts() ) while ( have_posts() ) : the_post(); ?> BTW this tutorial is a nonsense. while ( have_posts() ) would be sufficient, if is redundant there. – doc Feb 22 '14 at 9:57
up vote 0 down vote accepted

Add

<?php endif ;?>

after endwhile

share|improve this answer
    
Thanks!!! This worked. I thought I only needed one. – user2559519 Feb 22 '14 at 9:52

missing ; check and update

 the_permalink()
 the_time('F jS, Y')
 the_permalink()

replace it with

  the_permalink();
     the_time('F jS, Y');
     the_permalink();
share|improve this answer

You are missing ; in three function calls

<?php the_permalink() ?>
<?php the_author_posts_link() ?>
<?php the_permalink() ?>

replace it with

<?php the_permalink(); ?>
    <?php the_author_posts_link(); ?>
    <?php the_permalink(); ?>
share|improve this answer
    
That is how the tutorial wrote them. – user2559519 Feb 22 '14 at 9:53