Wordpress

How to Redirect WordPress Homepage to First Post

wordpress redirectYou may have seen some WordPress blogs without any homepage / index. This small wordpress code will automatically redirect all your visitors to your latest wordpress blog single post when trying to visit the homepage.

Add the following 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.

Note: You don’t need to change your htaccess file for this redirection.

About the author

admin

Leave a Comment


*