Error in Wordprewss loop for page template [closed]

I wasn’t able to recreate the error. Maybe it’s coming from <?php get_sidebars('right'); ?>

I did change your code a little, but it didn’t give the “unexpected endwhile” error you spoke of. If it’s coming from line 1 I’d guess it’s the header.php file?

Here is the adjusted code if you want to try it:

<?php 
/* 
Template Name: sliderpage */
?>
<?php get_header(); ?>
<div class="span-24" id="contentwrap">
  <div class="span-24" id="contentwrap">
    <div class="span-14">
      <?php
        $myslider=new WP_query('showposts=5&cat=13');
        //var_dump($myslider);
        if($myslider->have_posts()):
        while ($myslider->have_posts()) : $myslider->the_post(); 
        ?>
        <div id="slider" class="nivoSlider">
          <a href="https://wordpress.stackexchange.com/questions/51351/<?php the_permalink() ?>" class="post-image">
            <img src="<?php echo $featured_image_url [0]; ?>" alt="slider-image" title="<?php the_title(); ?>" />
          </a>        
          <?php endwhile; endif; wp_reset_query(); ?>          
        </div>

      <div id="content"></div>
    </div>
  <?php get_sidebars('right'); ?>
  </div>
<?php get_footer(); ?>

Your code also used <? instead of <?php. Short Tags aren’t supported in WordPress. Although this isn’t the cause of the error it’s good to practice proper coding standards.