I get an unexpected T_STRING error for this very commonly used WordPress code (loop), which is the only php code so far in the file. The problem line is the while line, which means the if line is somehow involved.
<?php
if (have_posts()):
while (have_ posts()) : the_ post()
?>
<a href="<?php the_ permalink(); ?>"><?php the_title(); ?></a>
<br>
<?php
the_content();
endwhile;
endif;
?>
I’m a newbie with php, so I’m sure I’m missing something obvious here.
You may have an extra space in
have_ posts(),the_ post()andthe_ permalink().