The seyDesign CDN will be retired on December 31, 2014.
Click here to learn if you are affected by the upcoming changes.

seydesign.com

{ robots ninjas who code }

Show Recent Posts

The "Show Recent Posts 2" snippet is a cute little implementation of SimplePie RSS parser designed with RapidWeaver® in mind. "Show Recent Posts 2" allows you to do just that, show your most recent blog posts on any other page (aside from your blog page of course), while maintaining some of your blog's original formatting. This version also includes the function for controlling the length of the posts. "Show Recent Posts 2" can be used in your main content area, in your sidebar, or wherever you think it would fit. You can get a copy here.

And for those looking for further assistance, please see this tutorial here.

thumbnail of show recent posts snippet

Installation

To install "Show Recent Posts 2", double click the .rwsnippet or drag and drop the file into ~/Library/Application Support/RapidWeaver/Snippets.

Usage

  1. Download a copy of the "simplepie.inc" file (http://simplepie.org/downloads/). Then attach it as an asset (View > Show Page Inspector > Header > Assets) to the page you want to the feed to appear.
  2. The page you are using the snippet on must have a .php extension.
  3. You will also need an empty "cache" folder inline with the same page. To do this in RapidWeaver®:
    • Add a new page (Styled text or HTML will do) inline with the page you are displaying the feed, leave it blank.
    • If using this snippet on the home page, adding any new page will make it "inline", otherwise, you will need to "nest" the new page within the page using the snippet.
    • Give the new page a page title, browser title, and folder name of "cache" and a filename of cache.html (View > Show Page Inspector > General)
    • disable "Show in Menu" (View > Show Page Inspector > General Settings > second check box from the top)
    • If running your script live on a remote server reports a "cache not writable" error, you may need to change the permissions of the cache folder to all write, all read, and all execute (CHMOD 777).
  4. Now you just need to drag the snippet anywhere on your site and change a few settings in the code to suit your needs:
    • You need to change the feed URL to match that of your own (currently set to http://www.seydesign.com/news/files/blogRSS.php)
    • You need to set the number of posts you wish to display (currently set to 0,5 which is 5 posts)
    • You need to set the number of days you wish to pull from (currently set to 168 hours or 7 days)
    • You need to set the length of the posts that will be displayed (currently set to 150)
  5. If adding the snippet to the main content area, highlight you snippet code and set the formatting to "Ignore Formatting" (Format > Ignore Formatting).
  6. If adding the snippet to the sidebar, it is best to add the snippet code to an HTML type sidebar and not a styled text sidebar. If you must add to a styled text sidebar, then refer to step 4.
RapidWeaver® is a registered trademark of Realmac Software.