Archive for October 26th, 2006

Recent Comments: WordPress Plugin

Update

13th January, 2007

Recent Comments Version 2.0.0 beta is now available. Largely rewritten, it includes better retrieval of comments, some new options and many more possible styles of display. Version 2 now has its own page where future developments will be documented.

Comments are now closed for this post but can be added to the new page.

Version 1.04 just fixes two bugs. The Posts plugin were not working if more than one was installed! Also some users were getting odd characters appearing where they shouldn’t.
Version 1.03 allows some parameters (like ‘before_title’) to be blank, or to be more complex, e.g., 'before_title=

. Also allows trimming an excerpt so it ends with a word or a sentence and not in mid-word. NB excerpt_length is now counted in characters and not words as previously.
Version 1.02 fixes bugs with the option to show static pages.
Version 1.01 fixes bugs with default settings when Similar Posts is not also installed.
Adds the skip parameter to ignore a number of posts at the head of the list.

 

Description

Simply displays a list of your blog’s most recently commented posts. Good for getting visitors to explore your site and interact.

This plugin was designed as a cousin to Similar Posts. It will work fine on its own but if Similar Posts is installed Recent Comments will take its settings from the Similar Posts options page.

Instructions

  1. Download the latest version of Recent Comments.
  2. Upload the whole plugin folder (Recent_Comments) to your /wp-content/plugins/ directory.
  3. Go to your Admin|Plugins page and activate Recent Comments.
  4. Putat the place in your WP loop where you want the list of recently commented posts to appear. By default the plugin wraps each post with
  5. and
  6. but that can be changed.
  7. The behaviour of the plugin can be adjusted in two ways. If Similar Posts is installed you can use its options page. Otherwise, a query-style parameter does the trick (see below).

Acknowledgements

Recent Comments was inspired by Scott Reilly’s excellent Customizable Post Listings plugin.

Under the Hood

The way the list of recent posts is displayed can be set from the Options|Similar Posts page (if it is installed). You can exclude certain categories of post, for example, or change the code that comes before and after the link.

These general options can be overridden in specific cases by passing a query-style parameter, e.g.:

<!--?php recent_comments('limit=10'); ?-->
lists the 10 most recently commented posts
<!--?php recent_comments('none_text=sorry&#038;show_static=false'); ?-->
lists the default number of posts, excluding static pages, and specifies what to display if there are none

If you do not specify an option its value is taken from the options page.
This means you can use the template tag in different ways in different places.

The full list of parameters is as follows (with the default value in parentheses):

limit
maximum number of posts to show (5)
skip
how many posts to skip before listing (0)
show_static
include static pages (false)
show_private
include password-protected posts (false)
excluded_cats
comma separated list of categories to exclude (by ID) (9999, the default means none)
excluded_authors
comma separated list of authors to exclude (by ID) (9999, the default means none)
none_text
what to show if no posts match–can be plain text or a permalink
before_title
what to show before a link ()
after_title
what to show after a link()
trim_before
remove the first instance of ‘before_title’ (false)
show_excerpt
include a snippet of the post after the link (false)
excerpt_length
how long an excerpt should be (50 characters)
excerpt_format
‘char’, the default, does nothing, ‘word’ trims the excerpt to the last full word, and ‘sent’ to the full sentence. If the excerpt would be trimmed to nothing no trimming is applied.
ellipsis
add ‘ …’ after the excerpt
before_excerpt
what to show before an excerpt ()
after_excerpt
what to show after an excerpt ()

Feedback

If you try this plugin leave a comment here to let me know how you get on.

8 comments October 26th, 2006

Recent Posts: WordPress Plugin

Update

13th January, 2007

Recent Posts Version 2.0.0 beta is now available. Largely rewritten, it includes some new options and many more possible styles of display. Version 2 now has its own page where future developments will be documented.

Comments are now closed for this post but can be added to the new page.

Version 1.04 just fixes two bugs. The Posts plugin were not working if more than one was installed! Also some users were getting odd characters appearing where they shouldn’t.
Version 1.03 allows some parameters (like ‘before_title’) to be blank, or to be more complex, e.g., 'before_title=

. Also allows trimming an excerpt so it ends with a word or a sentence and not in mid-word. NB excerpt_length is now counted in characters and not words as previously.
Version 1.02 fixes bugs with the option to show static pages.
Version 1.01 fixes bugs with default settings when Similar Posts is not also installed.
Adds the skip parameter to ignore a number of posts at the head of the list.

 

Description

Simply displays a list of your blog’s most recent posts. Good for getting visitors to explore your site.

This plugin was designed as a cousin to Similar Posts. It will work fine on its own but if Similar Posts is installed Recent Posts will take its settings from the Similar Posts options page.

Instructions

  1. Download the latest version of Recent Posts.
  2. Upload the whole plugin folder (Recent_Posts) to your /wp-content/plugins/ directory.
  3. Go to your Admin|Plugins page and activate Recent Posts.
  4. Put 

    at the place in your WP loop where you want the list of recent posts to appear. By default the plugin wraps each post with

  5. and
  6.  

    but that can be changed.

  7. The behaviour of the plugin can be adjusted in two ways. If Similar Posts is installed you can use its options page. Otherwise, a query-style parameter does the trick (see below).

Acknowledgements

Recent Posts was inspired by Scott Reilly’s excellent Customizable Post Listings plugin.

Under the Hood

The way the list of recent posts is displayed can be set from the Options|Similar Posts page (if it is installed). You can exclude certain categories of post, for example, or change the code that comes before and after the link.

These general options can be overridden in specific cases by passing a query-style parameter, e.g.:

<!--?php recent_posts('limit=10'); ?-->
lists the 10 most recent posts
<!--?php recent_posts('none_text=sorry&#038;show_static=false'); ?-->
lists the default number of posts, excluding static pages, and specifies what to display if there are none

If you do not specify an option its value is taken from the options page.
This means you can use the template tag in different ways in different places.

The full list of parameters is as follows (with the default value in parentheses):

limit
maximum number of posts to show (5)
skip
how many posts to skip before listing (0)
show_static
include static pages (false)
show_private
include password-protected posts (false)
excluded_cats
comma separated list of categories to exclude (by ID) (9999, the default means none)
excluded_authors
comma separated list of authors to exclude (by ID) (9999, the default means none)
none_text
what to show if no posts match–can be plain text or a permalink
before_title
what to show before a link ()
after_title
what to show after a link( 

)

trim_before
remove the first instance of ‘before_title’ (false)
show_excerpt
include a snippet of the post after the link (false)
excerpt_length
how long an excerpt should be (50 characters)
excerpt_format
‘char’, the default, does nothing, ‘word’ trims the excerpt to the last full word, and ‘sent’ to the full sentence. If the excerpt would be trimmed to nothing no trimming is applied.
ellipsis
add ‘ …’ after the excerpt
before_excerpt
what to show before an excerpt ()
after_excerpt
what to show after an excerpt ( 

)

Feedback

If you try this plugin leave a comment here to let me know how you get on.

26 comments October 26th, 2006

Random Posts: WordPress Plugin

Update

13th January, 2007

Random Posts Version 2.0.0 beta is now available. Largely rewritten, it includes some new options and many more possible styles of display. Version 2 now has its own page where future developments will be documented.

Comments are now closed for this post but can be added to the new page.

Version 1.04 just fixes two bugs. The Posts plugin were not working if more than one was installed! Also some users were getting odd characters appearing where they shouldn’t.
Version 1.03 allows some parameters (like ‘before_title’) to be blank, or to be more complex, e.g., 'before_title=

. Also allows trimming an excerpt so it ends with a word or a sentence and not in mid-word. NB excerpt_length is now counted in characters and not words as previously.
Version 1.02 fixes a bug with the option to show static pages.
Version 1.01 fixes bugs with default settings when Similar Posts is not also installed.
Adds the skip parameter to ignore a number of posts at the head of the list.

 

Description

Simply displays a list of posts chosen at random from your blog. Good for getting visitors to explore the depths of your site.

This plugin was designed as a cousin to Similar Posts. It will work fine on its own but if Similar Posts is installed Random Posts will take its settings from the Similar Posts options page.

Instructions

  1. Download the latest version of Random Posts.
  2. Upload the whole plugin folder (Random_Posts) to your /wp-content/plugins/ directory.
  3. Go to your Admin|Plugins page and activate Random Posts.
  4. Putat the place in your WP loop where you want the list of random posts to appear. By default the plugin wraps each post with
  5. and
  6. but that can be changed.
  7. The behaviour of the plugin can be adjusted in two ways. If Similar Posts is installed you can use its options page. Otherwise, a query-style parameter does the trick (see below).

Acknowledgements

Random Posts was inspired by Scott Reilly’s excellent Customizable Post Listings plugin.

Under the Hood

The way the list of random posts is displayed can be set from the Options|Similar Posts page (if it is installed). You can exclude certain categories of post, for example, or change the code that comes before and after the link.

These general options can be overridden in specific cases by passing a query-style parameter, e.g.:

<!--?php random_posts('limit=10'); ?-->
lists 10 random posts
<!--?php random_posts('none_text=sorry&#038;show_static=false'); ?-->
lists the default number of posts, excluding static pages, and specifies what to display if there are none

If you do not specify an option its value is taken from the options page.
This means you can use the template tag in different ways in different places.

The full list of parameters is as follows (with the default value in parentheses):

limit
maximum number of posts to show (5)
skip
how many posts to skip before listing (0)
show_static
include static pages (false)
show_private
include password-protected posts (false)
excluded_cats
comma separated list of categories to exclude (by ID) (9999, the default means none)
excluded_authors
comma separated list of authors to exclude (by ID) (9999, the default means none)
none_text
what to show if no posts match–can be plain text or a permalink
before_title
what to show before a link ()
after_title
what to show after a link()

trim_before
remove the first instance of ‘before_title’ (false)
show_excerpt
include a snippet of the post after the link (false)
excerpt_length
how long an excerpt should be (50 characters)
excerpt_format
‘char’, the default, does nothing, ‘word’ trims the excerpt to the last full word, and ‘sent’ to the full sentence. If the excerpt would be trimmed to nothing no trimming is applied.
ellipsis
add ‘ …’ after the excerpt
before_excerpt
what to show before an excerpt ()
after_excerpt
what to show after an excerpt ()

Feedback

If you try this plugin leave a comment here to let me know how you get on.

10 comments October 26th, 2006

Similar Posts: Version 1.10

I’ve uploaded a new version of Similar Posts. It allows you to exclude particular authors (if you have a multi-author blog), to specify the text that is shown when no matches are found, and to display the output as, for example, a comma-separated sequence rather than a html list.

Previous versions of Similar Posts used an option page as the sole method of governing its behaviour. This version lets you override those options on a case-by-case basis with a query-style parameter, e.g.,<!--?php similar_posts('limit=3') ?--> limits the output to three posts. The new scheme allows you to use Similar Posts in several different places in you blog with different behaviour. For example, you might want to display a few similar posts under each post on your home page and also have a longer list in the sidebar of your single pages.

October 26th, 2006


Calendar

October 2006
M T W T F S S
« Sep   Nov »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Posts by Month

Posts by Category