Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End {wordpress} Can the homepage resolve a post permalink?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27949

    Hey,
    I’ve been looking up and down for the answer to this one. Hopefully you can help.

    I would like the home page to resolve to the permalink of the most recent post in a given category.

    so, a visitor would visit website.com and they would be taken to > website.com/most-recent-post/

    I want a website full of single.php templated posts…

    #70721
    Chris Coyier
    Keymaster

    I’d say that’s a job for .htaccess, but it sounds like the redirect page would be different every time something new is posted? I’m sure there is some PHP that could get the job done… Hm…

    I think what I would do is set a static page as the homepage, that uses a unique page template in use by no other page. page-home-redirect.php or something. Then that page would run a loop… query_posts(), and return only one post, the most recent post. Then have PHP redirect (using header: … , or however that works) to the_permalink() of that post.

    #70774
    "travisneilson" wrote:
    Hey,
    I’ve been looking up and down for the answer to this one. Hopefully you can help.

    I would like the home page to resolve to the permalink of the most recent post in a given category.

    so, a visitor would visit website.com and they would be taken to > website.com/most-recent-post/

    I want a website full of single.php templated posts…

    That’s gonna be kind of a nightmare from an SEO point of view.

    Couldn’t you just put the most recent post on your homepage?

    #70835
    nutt318
    Member
    "davesgonebananas" wrote:
    Couldn’t you just put the most recent post on your homepage?

    That is what I would do and then in the wordpress settings limit your main post reading to 1

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.