Support » Fixing WordPress » Can I Redirect “Home” to Latest Post Permalink?

  • Hello All,
    I would like to know if it is possible to have my latest post be my home page. I know I can display the content and limit the display on the home page to 1 post but that’s not what I want.

    Is it possible to somehow “redirect” whenever someone requests my would get (the full post permalink).

    I was looking to maybe replace the <?php the_content(); ?> command in the index.php with a <?php the_latestPostPermalink(); command if something like that exists? Or something else to make my single.php show up rather than the index.php

    Any ideas?

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’d like to know this too. So far, I’ve found workarounds that will recreate the latest post page “look” on the homepage (it, with comments and all), but not the actual page with the permalink in the address bar.

    Evandiaz, I found this, which will recreate the single post page experience on the home page:

    But like I said, is there any way to actually _redirect_ to the latest post, the actual permalink page?

    you can do that with a redirect, but you would have to change the redirect every time you posted to get what you want. Not very efficient.

    c & p this file
    save as redirectify.php
    upload it to your plugins folder
    activate it
    go to post or page editor
    below post – in custom field area – put
    in value field – input your home url
    save post

    now any calls to home url will redirect to that post

    Thanks, does that mean that you would also need to delete that home url value from the _previous_ post?

    You’re right, though, it’s not very efficient, though I don’t post too often, so it’ll do the job. To do it right would probably require a function that would check on the database for the latest post. I have something like this running on a Nucleus blog that I’m thinking of porting to WP. Someone over there posted some code that had this effect and I seem to recall that it actually went to check to see what the latest post was.

    Thanks, does that mean that you would also need to delete that home url value from the _previous_ post?


    Well, I asked the same question in the comments of that post over at I mentioned earlier, and the site owner offered up some code. Replace the contents of your main index file with this, and it should work (it did for me!):

    if (have_posts()) : the_post();
    header("location: ".get_permalink());
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Can I Redirect “Home” to Latest Post Permalink?’ is closed to new replies.