Title: How to find syntax error parse error line
Last modified: August 20, 2016

---

# How to find syntax error parse error line

 *  [tripadora](https://wordpress.org/support/users/tripadora/)
 * (@tripadora)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/)
 * Hello! I created a blog page for my blog posts. I copied the index template as
   suggested and created a new file with blogtemplate.php. I edited some lines as
   instructed. But then after setting up the page, when i click on the blog page.
   I get this error: **Parse error: syntax error, unexpected $end in /home/nina9702/
   public_html/izah/wp-content/themes/twentyeleven/blogtemplate.php on line 26 **
   
   I don’t know how I can find the line 26 as indicated. Here’s my code `<?php /*
   Template Name: blog page*/ ?> <?php get_header(); ?>
 *  <div id=”primary”>
    <div id=”content” role=”main> <?php if ( have_posts() ) :?
   > <?php twentyeleven_content_nav( ‘nav-above’ ); ?> <?php /* Start the Loop */?
   > <?php $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query(); $wp_query-
   >query(‘posts_per_page=5′.’&paged=’.$paged); while ($wp_query->have_posts()) :
   $wp_query->the_post(); ?>
 *  <?php get_template_part( ‘content’, get_post_format() ); ?>
    <?php twentyeleven_content_nav(‘
   nav-below’ ); ?> <?php $wp_query = null; $wp_query = $temp;?>
 *  </div><!– #content –>
    </div><!– #primary –> <?php get_sidebar(); ?> <?php get_footer();?
   >`

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2229797)
 * This seems to work for me –
 *     ```
       <?php
       /*Template Name: blog page*/
       ?>
       <?php get_header(); ?>
   
       <div id="primary">
       <div id="content" role="main>
       <?php if ( have_posts() ) : ?>
       <?php twentyeleven_content_nav( 'nav-above' ); ?>
       <?php /* Start the Loop */ ?>
       <?php
       $temp = $wp_query;
       $wp_query= null;
       $wp_query = new WP_Query();
       $wp_query->query('posts_per_page=5'.'&paged='.$paged);
       while ($wp_query->have_posts()) : $wp_query->the_post();
       ?>
   
       <?php get_template_part( 'content', get_post_format() ); ?>
       <?php endwhile; ?>
       <?php twentyeleven_content_nav( 'nav-below' ); ?>
       <?php else : ?>
       <?php $wp_query = null; $wp_query = $temp;?>
       <?php endif; ?>
       </div><!-- #content -->
       </div><!-- #primary -->
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 *  Thread Starter [tripadora](https://wordpress.org/support/users/tripadora/)
 * (@tripadora)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2229799)
 * Hello Clayton!Thanks for the reply. my blog page is now working. But I found 
   another problem. Only one post is appearing even if 5 was indicated in the code.
   There’s also no pagination. Hope you could help. thanks
 *  Thread Starter [tripadora](https://wordpress.org/support/users/tripadora/)
 * (@tripadora)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2229801)
 * Thanks for the help. I figured out that one of the plugins is causing it. I resolved
   it already.
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2229802)
 * The code that I added a couple of lines to and posted above displays my 5 latest
   posts with functioning page navigation on my test site using Twenty Eleven. The
   only thing I did differently when I tested your template on my site, was removed`
   <?php get_sidebar();? >`. I’m not sure where to point you.
 * [edit] Glad you got it working. Good luck to you!
 *  [timorelo](https://wordpress.org/support/users/timorelo/)
 * (@timorelo)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2230196)
 * Hi, ClaytonJames, How do you display ASC?
 * thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘How to find syntax error parse error line’ is closed to new replies.

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [timorelo](https://wordpress.org/support/users/timorelo/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/how-to-find-syntax-error-parse-error-line/#post-2230196)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
