I have a Wordpress blog site that I am building. My problem is that when the homepage loads it shows my earliest post from three years ago. What I would like it for my most recent post to show instead. Can anyone tell me how I could accomplish this. I have looked through several articles and none have a solution that work for me. Here is the code I am using to load the post:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h4>Posted on <?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr> <?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php
endif; ?>
pre_get_posts
action which is altering the main query on your homepage, either in your theme or in a plugin you are using.