To apply this tip, paste the code below to your homepage file (Most of the time it is named index.php). Please note that you’ll receive a PHP warning if you try to display anything before the wp_redirect() function on line 10.
<?php
/*
home.php (Blog Home Page):
Redirect To First Post
*/
if (have_posts()) {
while (have_posts()) {
the_post();
wp_redirect(get_permalink());
}
}
?>
Thanks to Ashton Sanders for the tip!
Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!
How to redirect your homepage to the first post