0

I'm sure this is a simple fix, but I haven't been able to apply previous answers properly. When debugging I received this error:

Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF)

Any help is appreciated. Thanks.

The code:

<?php get_header(); ?>

<div class="container">

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

<div class="row">   
    <div class="col-sm-5">  
        <div class="image_cont img_width_sgl" style= "background: url(<?php the_field('post_image'); ?>) no-repeat center center; background-size: cover;">
    </div>
</div>

<div class="row">           
    <div class="col-sm-5">
        <h2><?php the_title();?></h2>
        <h3><?php the_time('l, F jS, Y'); ?></h3>
    </div>      
</div>

<div class="row">   
    <div class="news_cont">
        <?php the_content();?>  
        <p class="back_btn_news">
            <a href="http://vplc.rpmdevserver.com/news/" class="">BACK TO NEWS</a>
        </p>
    </div>
</div>

<div class="row">
    <div class="col-sm-5">          
        <?php comments_template(); ?>
    </div>
</div>

<?php endwhile; ?>      

sanzanobi
  • 27
  • 6
  • 2
    Not sure what we can add to what the error says - you don't close your if statement at the end of the file. – iainn Jan 05 '18 at 15:27

1 Answers1

0

You need to add:-

<?php endif; ?><!-- so that if condition closed properly -->

After:-

<?php endwhile; ?>
Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98