Random Featured Post Plugin
Download from WordPress.org
The Featured Post plugin allows you to display a random post from a designated category. Ideally this should draw readers landing on your homepage to some of your best posts. The featured post will display the title ‘Featured Post’ (customizable) along with the post’s title, an excerpt and a link to continue to the full post.
Can You Have More Sales, Too?
Here at MyDollarPlan.com we use AWeber’s opt-in email marketing software to reach our subscribers. If you’re serious about raising profits and building customer relationships like we are then take a FREE test drive now!
This plugin requires WordPress version 2.3 or higher and has been tested up to version 2.5.1. User reports suggest compatibility up to 2.9.2 but I have not tested or verified.
- Download and unzip featuredpost.zip (see below) to your plugin folder.
- Activate the plugin from the Plugins section of your dashboard.
- (Optional) Create a ‘Featured’ category.
- Go to the ‘Featured Post’ options in your dashboard and select the categories from which you would like posts to be randomly selected.
- Check the ‘Show Featured Post’ box and click ‘Update’ to save your changes.
- Place a call to the show_featured_post() function in your template, most likely in your main index template just before the loop. See additional notes below.
- The show_featured_post($PreFeature = ”, $PostFeature = ”, $AlwaysShow = false, $categoryID = 0) function has five optional arguments. The first two are for any HTML you would like to display before and after the featured post. The third argument is a boolean (true/false) argument which will override the ‘Show Featured Post’ option and always display the featured post when true. The fourth option allows you to specify a category to display from, overriding the selection in settings page.
- If you choose to display excerpts, the plugin will display your optional custom excerpt from the advanced options section of your post; otherwise, the standard WordPress excerpt is shown. The fifth option allows you to show more than one post at a time, overriding the settings page option.
- This plugin respects the <!–more–> tag when you choose to display the full content. There is a setting which allows you to ignore the tag and display the full post.
This example will display the featured post only on your homepage inside a span block:
if ( function_exists('show_featured_post') ) if (is_home() && !is_paged()) show_featured_post('<span class="container">','</span>');
- This example will always display the featured post, ignoring the ‘Show Featured Post’ option and the category ID option in settings:
if ( function_exists('show_featured_post') ) show_featured_post('', '', true, 42);
- All output is contained in a DIV class named “featuredpost” and can be adjusted via your stylesheet.
v1.1.3 (May 15, 2008)
- Bug fix: more tag was not being respected on single posts/pages when full content option was selected.
v1.1.2 (May 5, 2008)
- Added option of showing posts and/or static pages.
v1.1.1 (April 30, 2008)
- Added multiple category selection option.
- Added option to display multiple posts.
v1.1.0 (April 28, 2008)
- Discontinued use of truncated post content and switched to the option of displaying full post content with HTML intact or standard excerpts, custom or WordPress generated.
- Added option to ignore the <!–more–> tag when displaying full post content.
- Added fourth argument to show_featured_post() function to allow category ID from settings to be overridden.
v1.0.1 (April 11, 2008)
- Added category name and ID table to options page for convenience.
v1.0.0 (April 7, 2008)
- Initial plugin release.
Download from WordPress.org