• I did some searching, but couldn’t find an answer.

    WordPress is going to be used as a pseudo-cms for news items. So the web sites home page will not be wordpress.

    the sites structure…
    /
    /index.php
    /news/ <— where wordpress is installed

    I’d like the homepage to display the 5 latest posts. The list should link to the respective items in wordpress too. Is this possible?
    I’d prefer to use wordpress’s functionality so I can learn the inner workings. If not, I’m guessing I can always query the database myself.
    Any hints would be great! Thanks in advance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • In your main page (or wherever you want to put the posts), include this somewhere on the page (gotta be a php page):

    <?php include("/news/wp-blog-header.php"); ?>

    Then, where you want to put the posts:

    <ul>
    <?php wp_get_archives('type=postbypost&limit=5'); ?>
    </ul>

    You can also use something like CG-FeedRead to periodically grab the RSS feed of the WP site for display… I know lots of folks doing that. (CG-FeedRead doesn’t depend on WP, even though I have features to help it ‘integrate’ better…).

    -d

    Thread Starter jbjaaz

    (@jbjaaz)

    Thanks for the code. I actually didn’t use the wp_get_archives function. Once I realized that include("/news/wp-blog-header.php"); takes care of all the initialization and database querying, I was able to pull code from index.php to output a more customized list than what wp_get_archives would give me.

    I would like to do the same thing, but my homepage isn’t php, just html

    what code do I USE?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘posting latest posts outisde of wordpress’ is closed to new replies.