Adding Excerpts to a Page Outside of WordPress (6 posts)

  1. fx3000
    Posted 9 years ago #

    I would like to add excerpts of my latest posts to my home page which is a static page outside of my WordPress pages. Is there a way to do this? I guess I probably could turn my home page into a WordPress "page", but I would rather find a way that I could call WordPress functions on a page outside the WordPress system.


  2. moshu
    Posted 9 years ago #

    If that file is a .php file - just put this at the top of it (before everything else)

    and then you can use any WP function in that file, including plugins (e.g. recent posts), The Loop, template tags etc.

  3. fx3000
    Posted 9 years ago #

    It would indeed be a .php file, so I will give this a try.
    Thanks a lot, moshu.

    WordPress Rocks!

  4. moshu
    Posted 9 years ago #

    Oops! I forgot to tell you but hopefully you figured out:
    include the correct path to where your WP install is! i.e.


  5. davidchait
    Posted 9 years ago #

    or, if you don't want the overhead of loading up the entirety of WP every time your home page loads, you can use something like CG-FeedRead to grab your own RSS entries, and display them on your homepage. That way the stuff is cached, only 'loads' WP as part of a request for the feed (once every N hours), minimal impact on your main page load time.


  6. moshu
    Posted 9 years ago #

    Yes, that's even better - especially if you just want to display some posts/excerpts.

Topic Closed

This topic has been closed to new replies.

About this Topic