Grow your CSS skills. Land your dream job.

{wordpress} Can the homepage resolve a post permalink?

  • # February 10, 2010 at 2:10 am

    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…

    # February 10, 2010 at 1:47 pm

    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.

    # February 11, 2010 at 4:34 pm
    "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?

    # February 12, 2010 at 2:48 pm
    "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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".