Hi,
I am very new to PHP coding and am sure that this little piece of work could be a lot tidier! Any helpful suggestions would be gratefully received and acted upon.
<?php
if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="container">
<article class="post">
<!-- No title hyperlink on single page -->
<?php
if (is_single()) : ?><h2><?php the_title(); ?></h2>
<?php else :
?> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<?php endif;
?>
<p><?php the_content(); ?></p>
</article>
</div>
<?php endwhile;
else :
echo '<p>Sorry, no content found.</p>';
endif;
?>
Kind thanks in advance,
Gary.