WordPress.org

Ready to get started?Download WordPress

Forums

static homepage with latest post section (10 posts)

  1. overlander
    Member
    Posted 7 years ago #

    Is it possible to have a static home page (index page, whatever you want to call it) where you can have a section that remains static, and doesnt change, and a section that displays your latest post. A bit like the html sites of old which would have a php news section?

  2. rylanherring
    Member
    Posted 7 years ago #

    If I understand your question I stumbled onto it just the other day. In your dashboard go to the "Reading" tab under "Options" and you can change the display of your "Front Page".

  3. overlander
    Member
    Posted 7 years ago #

    Yes, but I would like a static frontpage, with a section that features my latest post, how do I do this?

  4. joshnunn
    Member
    Posted 7 years ago #

    There is a plugin called Inline Feed that allows you to display an RSS feed anywhere in a page. You can use this plugin in your static front page and feed it the RSS feed from your posts. I used it for a while on my site (although I don't anymore). Any plugin that will display an RSS feed will do.

  5. moshu
    Member
    Posted 7 years ago #

    Or any recent posts plugin... for that matter.
    Just be a bit inventive: create a Page template for that frontpage of yours and include in the template whatever you need.

  6. landscribe
    Member
    Posted 7 years ago #

    Great, this was just the question I'm looking for an answer to. Thanks for the tips about plugins -- but, just curious, is there a way to do this on your static front page with the WordPress loop or similar?

  7. landscribe
    Member
    Posted 7 years ago #

    Just found a post at Big Square Blog that does this nicely: http://www.bigsquaredot.com/blog/2007/03/12/display-wordpress-entries-on-static-pages/

  8. Sivar
    Member
    Posted 7 years ago #

    Why do it the difficult way accessing the DB directly? One can do it with a query and a small loop:

    <?php // query posts for the desired categories (10,11,12) and display the 10 recent ones
    query_posts('cat=10,11,12&showposts=10');
    while (have_posts()) : the_post() ?>
    // loop content
    <?php endwhile; ?>

    Since you don't need the original query for any other content of your static front page, you don't even need to bother to save and restore it using an "auxiliary" variable.

  9. landscribe
    Member
    Posted 7 years ago #

    Sivar, thanks. But I tried what you suggest, and pasted your code (amending the category numbers) into my static page template - which resulted in no output.. no error message, but also nothing posted.

    I'm thinking you have to do something a bit more complicated than a basic loop with a template static page...?

  10. landscribe
    Member
    Posted 7 years ago #

    See this post for a solution using the WordPress loop.

Topic Closed

This topic has been closed to new replies.

About this Topic