Posted on 23rd Jan, 2008 23rd Jan 08
Posted by fran fran

Recent Pages and Posts Plugin

When using WordPress as a CMS, I’ve found that clients sometimes want to treat pages as a source of regularly updated information, as well as using the regular post features of their blog. There’s a lot of plugins available which offer lists of regularly added posts, but I hadn’t been able to find any which provided lists of recently published pages.

This plugin fills that gap. Via the use of a custom template tag, this plugin will enable you to output a list of either recently added pages, or posts, wherever you decide to call it within your theme.

Spacer_Main

Configurable features

  • Output a list of recently added Pages or Posts.
  • Specify the number of Pages or Posts to output in the list.
  • Specify the length of excerpt which follows post or page title, defined as a wordcount. Excerpt is stripped of HTML formatting.

Format Of Output

The plugin outputs its information in an <ul> with a class name of ‘recent_p_p’, so that it can be targeted via CSS if desired. Each post or page’s information is presented as a nested <ul><li> within that parent list.The page or post heading resides within a <h2> tag.

Spacer_Main

Usage

This plugin is called via the template tag ‘recent_p_p()’. One can configure the plugin via this tag – giving you control over its output on a per-instance basis, or use its default values.

When configuring its output, the template tag takes the following format:

recent_p_p(DOCUMENT TYPE, DOCUMENT COUNT, DOCUMENT EXCERPT LENGTH)

DOCUMENT TYPE (Default: page)

String – enter ‘page’ for page based results, ‘post’ for post based results.

DOCUMENT COUNT (Default: 3)

Integer – enter number of posts / pages to output in the resulting list.

DOCUMENT EXCERPT LENGTH (Default: 10)

Integer – Specify the desired Wordcount of the page or post excerpt.

Spacer_Main

Examples

Plugin Output Example

<?php recent_p_p(page,5,30); ?>

This example would output a list of recent pages. There would be 5 pages in the list, and they would be accompanied by a 30 word excerpt of each page.

<?php recent_p_p(post,10,15); ?>

This example would output a list of recent posts. There would be 10 pages in the list, and they would be accompanied by a 15 word excerpt of each post.

Spacer_Main

Installation

Download the latest version of the plugin, unzip and upload recent_pages_posts.php to your ‘wp-content/plugins’ folder. Activate it via your administration plugins screen, and deploy the recent_p_p() tag within your theme, wherever you want the lists to be displayed.

Support

If you have any problems with the operation of this plugin, please drop me a comment here, or use my contact form. Similarly, if you would like to see any further features implemented in a later version, do feel free to drop me a line!

Licence

This plugin is distributed under a GNU general public licence.

Spacer_Main

Download Version 0.1 of Recent Pages and Posts Plugin (23/01/08)

You can download it here : )

Spacer_Main

If you find this plugin useful, please consider buying me a fine cheese, trombone or donkey via the paypal donate button. Thanks!

Spacer_Main



Tags: ,

  • Tenuously Related Posts: