0

I have php code like this

<?php 
            if ( have_posts() ) : while ( have_posts() ) : the_post();
                get_template_part( 'content', get_post_format() );

            endwhile;

            <?php next_posts_link( 'Previous' ); ?>

        endif;

?>

However, I get this error:

Parse error: syntax error, unexpected '<', expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) in .../index.php on line 14

Line 14 is: <?php next_posts_link( 'Previous' ); ?> , remove this line it works normally

I use Atom for PHP coding and I see the endif; ?> get grayed out

chris85
  • 23,846
  • 7
  • 34
  • 51
superquanganh
  • 409
  • 4
  • 9

1 Answers1

0

Well, for anyone or newbies want to know the answer. I just need

next_posts_link( 'Previous' );

instead of

<?php next_posts_link( 'Previous' ); ?>
superquanganh
  • 409
  • 4
  • 9