WordPress.org

Ready to get started?Download WordPress

Forums

Pull Last 5 Entries as a PHP Include (6 posts)

  1. jzader
    Member
    Posted 9 years ago #

    I need to pull the last 5 entries from my blog as an include. In other words, the blog is just one component of a larger site, and I want to include excerpts of the last 5 entries on the main page of the site. My problem is: How do I create a file that I can then include in this fashion? I.e., where it contains the necessary dynamic variables, but isn't going to get pre-processed by the WordPress software. Thanks in advance for any help...!

  2. Beel
    Member
    Posted 9 years ago #

    Find and use CG-Feedread

  3. Hm, I'm afraid that CG-Feedread won't work in this case. Instead, all you have to do is add the Loop to your pre-existing webpage.

    http://codex.wordpress.org/The_Loop
    http://codex.wordpress.org/The_Loop_in_Action

    For more info, please do a search here for "integrate" or "the loop".

    Here are a few more resources:

    http://www.transycan.net/blogtest/2005/07/05/integrate/

    http://www.jonathanwold.com/tutorials/wordpress_integration/

    http://mattread.com/archives/2005/04/wordpress-is-not-php/

  4. jzader
    Member
    Posted 9 years ago #

    Thanks for these two replies. Regarding the first recommendation (CG-Feedread), I've downloaded it and started fiddling with it, but it's very poorly documented and I don't think it allows me to apply style settings to entries. ...Unless I'm missing something.

    Regarding the second recommendation ("just add the Loop to your pre-existing webpage) ... I don't see how I can use the Loop (which is a function defined by WordPress's software) on a page that is outside WordPress's purview.

    I welcome further clarification.

    ...IN FACT, if somebody will hold my hand through an implementation on this, I'll happily send you $50.00 (by PayPal or by check) as soon as it's implemented. (I'm willing to pay cash because this is a commercial project and I have an urgent deadline. I had to ditch MoveableType at the last minute and so my learning curve is killing me.)

    My e-mail address is webstuff at zader dot com. I'm going to go get a little sleep and then hopefully wrap this up in the morning.

  5. Check your e-mail.

  6. Beel
    Member
    Posted 9 years ago #

    CG-Feedread works fine for pulling the five latest posts into another site I have it comes wrapped in sufficient tags to wrap however I want - without the overhead of using WP. I am off to the mountains to do a little trout fishing and hiking with the dog but will check back later.

Topic Closed

This topic has been closed to new replies.

About this Topic