Configuring the Post Plugins


Unfortunately, due to ill-health, these plugins have not been developed or supported properly for some years. They still work under most circumstances with the latest versions of WordPress (including on this website) but could possibly conflict with any WordPress features added after 2008 — e.g. custom post types — if you use them.

The post plugins, Similar Posts, Recent Posts, Random Posts, Popular Posts, and Recent Comments, should work ‘straight out of the box’. For example:


will display an unordered list of links to the five posts most relevant to the current one.



will show a list of the five most recent comments and their authors (the extra code protects your site from breaking if you should ever deactivate the plugin).

You can style the lists any way you like by playing with your theme’s CSS.

If the latest version of the Plugin Output Cache is installed the post plugins (apart from Random Posts) will have their output cached for efficiency.


We saw above that you can place the output of the post plugins anywhere you want by editing the code of your theme files. You might, however, not feel comfortable doing that or you might not like to re-edit the theme every time it is updated: the Post Plugins offer several other ways of placing their output without touching your theme files.

If your theme is designed to use widgets you can use the Presentation/Design admin menu to place the plugins as widgets into the sidebar (or anywhere else the theme allows). The plugin’s Placement submenu also lets you pass a parameter string (see below) to the widget and/or decide which pages it should appear on.

You might instead want to place the plugin output after the content of your posts. The plugin’s Placement submenu lets you do just that. Again you can pass a parameter string and/or choose which pages should show the output (e.g., ‘is_single()’ will keep output off the front page and just on single post pages; ‘!is_single()’ will do the opposite). If other plugins are also adding their output after the body of a post the order in which they appear can be important. By adjusting the priority of the the plugin’s placement you can achieve the order you want.

The Post Plugins can also append themselves to your site’s feed. The settings are again reached from the Placement submenu.

Finally, the plugins can be injected into individual posts and pages by inserting special place-holders. The content filter option must be turned on from the Other submenu. The place-holders look like this:


If the content filter is off the place-holder is invisible but otherwise is expanded to display the plugin output. You can pass a parameter string to the place-holder, e.g., <!--RandomPosts limit=2-->.


What if you want just three items in the list? Or what if you want to include an indication of how many comments each post has? You need to configure the plugin’s if you want just three items in the list? Or what if you want to include an indication of how many comments each post has? You need to configure the plugin’s settings.

Each of the post plugins has a Settings page which is accessible if you are logged in with the capability to manage options–in the role of administrator (WordPress 2+) or user level 8 or above (before version 2). All the settings are listed below. Most of the options apply to all of the plugins.

Beware of choosing settings which are contradictory (e.g., include and exclude the same post) or so restrictive as to reduce matches to zero (e.g., matching both the current post’s category and tags).

Number of posts to show
The default is 5.
Number of posts to skip
Allows you to start part way ‘down’ the list of posts. For example, you could call Recent Posts twice, once with skip set to 0 and once set to 5 to produce a two-column listing. The default value is 0.
Omit current post?
On some occasions you may want the current post to be dropped from the output. By default Similar Posts omits the current post while the other post plugins include it.
Show password-protected posts?
By default posts which are password-protected are not shown but they can be included by setting this option.
Show static pages?
WordPress has static pages as well as the normal flow of posts. You can choose to show both pages and posts or either one alone. By default, only posts are included.
Show attachments?
WordPress stores attachments (or links to them) among normal posts and pages. You can choose to show them if you wish. By default, they are not included.
Show by status
WordPress assigns posts a status, e.g., whether they are published or not. This option lets you display posts with chosen states: published, draft, private, and future.
Ignore posts older or newer than…
Sometimes it is useful to only include posts that are more than, or less than, a certain number of days, months, or years old. A news site might want to show random posts from the last week, for example.
Match posts by custom field
If you wish you can use the very flexible post-meta system to select posts. At the most basic you can limit matches to posts where a specific custom field exists. You can also check that a custom field has a certain value. The ‘LIKE’ operator can be used with wildcards (‘_’ matches any single character, ‘%’ matches zero or more characters). You can even use the MySQL REGEXP operator for complex matches. Please bear in mind that matching by custom field may slow down the plugin considerably.
Limit matches to same category?
By default, posts from any category are included but it can sometimes be useful to restrict the display to just those posts which share at least one category with the current post.
Match the current post’s tags
This option (only available for WordPress 2.3+) uses the current post’s tags to restrict the output. It can look broadly for posts with any of the tags, or strictly for all of the tags. If the current post is untagged or there are no matching tags the normal output is produced
Match the current post’s author
This option let’s you restrict output to posts which share the current post’s author
Default display if no matches
Occasionally, for whatever reason, a plugin has no items to display. By default it displays instead the text 'None Found' but you can change the message to fit your blog or language. You could even include a link,say, to your ‘about’ page. The before and after settings are ignored but if you embed output tags they will be expanded.
Show nothing if no matches
As an alternative to displaying a default message, this option causes the plugin to produce no output at all (from v. also works when the pluginj is used as a widget).
Text and codes before the list
Lets you specify text and HTML before the list of items, e.g., to title the list. By default is used.
Text and codes after the list
Lets you specify text and HTML after the list of items. By defaultis used.

Output template
The output template specifies what gets displayed for each item in the output. For example, the default output template for Recent Posts is

  • {link}


. Read from left to right it governs the output for each item in the list of recent posts. In this case it is a beginning and ending HTML list tag with something in between. The code, {link}, gets expanded for each item — and displays the post’s permalink with the post title as the text and the date of posting as the ‘tooltip’.
The output template treats anything between ‘{‘ and ‘}’ as a special instruction or tag. A full list of output tags is given below. The tag system allows you to customise the plugin’s output to a high degree, for example,

{link} by {author} ({commentcount} comments)
{snippet:50} …
outputs each item as part of a definition list showing the permalink, the author, and the number of comments the post has, followed by a 50-character snippet of the content and a trailing ellipsis.
The exact way these elements are displayed depends on your theme’s CSS. Applies to each plugin.
Text to trim at start replaced by ‘divider’
usually the plugin output will be some kind of list with each element sandwiched between matching tags. Sometimes, though, you might want to have the output separated rather than wrapped: a comma-separated sequence of items would be an example. The output template ', {link}' would basically do the trick but would produce an unwanted ', ' at the front of the first item. This option lets you enter ', ' and have the offending comma and space trimmed neatly out of existence.
usually the plugin output will be some kind of list with each element sandwiched between matching tags. Sometimes, though, you might want to have the output divided rather than wrapped: a comma-separated sequence of items would be an example. The output template '{link}' would basically do the trick but with divider set to ‘, ‘.
Authors to exclude/include
By default the plugin selects posts with no attention to who wrote what. By checking the appropriate boxes you can include or exclude posts by certain authors.
Posts to exclude
By default the plugin considers all matching posts in preparing its output. By including a comma-separated list of post IDs you can exclude particular posts from consideration.
Posts to include
By default the plugin considers all matching posts in preparing its output. By including a comma-separated list of post IDs you can only consider particular posts.
Categories to exclude/include
By default the plugin selects posts without caring how they are categorised. By checking the appropriate boxes, however, you can exclude or include posts in certain categories.
This option (available for WordPress 2.3+) lets you specify a tag or list of tags to filter the output. For example, TAG A selects any post with that tag; TAG A, TAG B selects any post with either tag; and TAG A + TAG B selects only posts with both tags.
Other plugins’ tags to remove from snippet
If {snippet} is present in the output template the plugin tries to produce a simple glimpse of the post’s content without HTML or markup. However, many plugins insert pseudo-tags of their own which can mess up the snippet. If you want these tags to be fully expanded you can use the {excerpt} output tag instead but if you simply want them cut out from your post you can specify a set of opening and closing pseudo-tags to be removed.
For example, '[tag]' and '[/tag]' will cut out the whole of '[tag]embedded stuff[/tag]' while '[' and ']' will remove '[insert stuff here]'. In these examples it would be very important to place '[tag]' above '[' so they are removed in the right order. Pseudotags which contain modifiers, e.g., [quote comment=12], can be removed with the aid of a wildcard, e.g., [quote.*].
Content filter
Ordinarily, the plugin’s output is displayed wherever you place the tag in your template or, alternatively, where you place the corresponding widget. This option offers a third method of placement: a filter which looks for embedded tags in content. For example, the tag <!--SimilarPosts--> placed in the body of a post would be replaced by a list of similar posts. This lets you insert plugin output on a post by post basis. Use <!--SimilarPosts-->, <!--RandomPosts-->, <!--RecentPosts-->, , or <!--RecentComments-->. You can pass a parameter string to the plugin by putting the string after the tag, e.g., .
Note: even when the content filter is active the tags will not be expanded if they are being shown via one of the plugins, e.g., if Recent Posts is showing the excerpt of a post with a tag in it, the tag cannot be expanded with infinite recursion.
Sorted/Grouped Output
Each plugin produces a number of items sorted in the most usefulmanner for that plugin but you might want to sort the items differently. With these options you can sort the output according to the value of any (combination) of the output tags (though obviously some tags make little sense). You can sort in ascending or descending order and, where relevant, ignore case or not.These options let you choose two levels of sorting. Items will be sorted by the first set and then by the second. It is also possible to specify a group template so that groups of items which sort together can be titled appropriately. Note: The sort order does not change the output of the plguin, only the order in which it is displayed.

Group title template
This ‘title’ for each sorted group of items is specified in exactly the same manner as the output template. It appears whenever the primary sort tag changes.

The following options are only available in Similar Posts:

Maximum number of words to use for match
By default Similar Posts selects 20 words from a post to make its matches but this value can be adjusted to give the best results for your blog.
Relative weight of post title, content, and tags
Similar Posts lets you adjust the contribution the current post’s title, content, and tags make when looking for a match. The three numbers are specified as percentages and should add up to 100. Choose what works best for your particular set of posts.
Manual links
If this option is switched on you can use custom fields to override the automatic matching algorithm. From the write/edit screen enter a custom field named ‘sp_similar’ with the ID of the post or page to which you wish to make a manual link. Multiple links can be made with a comma-delimited list of IDs.
Term extraction algorithm
The quality of the automatic matches depends on the extraction from a post’s content of key terms which represent the post’s meaning. The original algorithm uses relative word frequency to pick terms. You can also choose a more sophisticated method which uses TextRank to extract key terms. In general this leads to better similarity scores but that may or may not correspond to the user’s sense of similarity.
Add output to feeds
Appends a similar posts list to feeds. Previously this was handled by a separate plugin.

The following options are only available for Recent Comments:

Show only one comment per post
The plugin usually lists all comments but you can choose to show only the latest comment for any post.
Type of comment to show
In addition to ordinary comments there are trackbacks and pingbacks. By default Recent Comments only displays ordinary comments but you can choose to show all kinds of comment or just trackbacks and pingbacks.
Type of grouping
The list of recent comments is usually displayed according to the order in which the comments were made but sometimes you might want to group comments by post or by commenter. If you choose to group the comments you may well want to give each group a heading using the group template. (This option is a specific case of the many ways of sorting the output — basically it overrides any sorting options)
Show just current post
Sometimes you want to only list comments for the current post.
Omit author comments
By default the plugin lists all comments but you might want to exclude comments by the author of the post itself. Note that this option relies on the author being logged in while commenting.
Omit user comments
By default the plugin lists all comments but you might want to exclude comments by registered users of your blog. Note that this option relies on the author being logged in while commenting.

The following option is only available for Recent Posts:

Select posts by date modified
Instead of the usual behaviour of ordering output by date of creation you can chose to select the posts which have been changed most recently.

Output Template Tags

Several output template codes or tags were mentioned above. They offer a very flexible way to tell the plugin what aspects of a post to display and new tags are easily added to extend a plugin.

For example, {author} expands to the name of the post’s author and {date} becomes the date the post was created. An output template of 'by {author} on {date}' might expand, for example, to ‘by Rob on January 1, 2007’. Dates, however, can be expressed in different ways. By default {date} uses the same date format as the blog but if you wanted a different format you could specify it as a kind of parameter to the {date} tag. For example {date:Y} would just give the year in 4-figure format.

The general form for an output template tag is '{tagname:parameter1:parameter2:...}', where the curly brackets identify the tag as a tag, the ‘tagname’ picks out the tag from a list of valid tags, and the optional ‘:parameter’ allows some output tags to be fed extra data. If a tag can take a parameter and none is supplied a default value is used and if a tag cannot handle a parameter and one is supplied it is ignored.

The various output tags call the same internal filters as WordPress does so that, if, for example, you have installed a plugin to translate foreign-language characters, the plugin output should also be translated.

The current list of tags is as follows (colon indicate the tag has parameters)

The post’s title. If maxlength is specified the title wraps after that many characters. Method can be ‘wrap’, ‘chop’ (which simply truncates), ‘trim’ (which chops but adds an …), or ‘snip’ (which puts the ellipsis in the middle.
The post’s permalink as a url. See {title} for parameters.
The ID column of the post’s entry in the database.
The name of the post’s author. The default method ‘display’ uses the author’s display name; ‘first’ uses the first name; ‘last’ the last name; ‘full’ is equal to ‘first last‘; and ‘reverse’ to ‘last, first‘.
The url of the permalink to the archive of the author’s posts.
The date the post was created — a date format can be specified or the blog’s default will be used, e.g. {date:Y, F} would print something like ‘2007, January’. A format of ‘raw’ gives a value sueful for sorting.
The date the post was last edited. See {date} for parameters.
The time the post was created. See {date} for parameters.
The time the post was last edited. See {date} for parameters.
An excerpt of the post. Maxwords is the desired size of the excerpt (defaults to 55). Method, which can be ‘a’ or ‘b’ governs the way the excerpt is generated: ‘a’, the default, uses the same method WordPress itself employs, taking the post excerpt if available or the post content if not, stripping tags and then truncating to length; ‘b’, respects embedded '<span id="more-523"></span>' tags and tries much harder to preserve formatting. The more parameter, which only applies to method b, lets you specify the text and codes to append to the output (by default, ‘ …’). If the link parameter is ‘link’ whatever you have chosen in more will be linked back to the post. If you set a value for sentences no more than that number of whole sentences will be included in the excerpt. If sentences is set to 0 the excerpt will be trimmed to the end of the last full sentence less than maxwords.
A lightweight extract from the post, stripped of tags (and pseudotags). For example, {snippet:50} gives a snippet 50 characters long. The default is 100. Method defaults to ‘char’ but can also be ‘word’ which measures in words instead. Both approaches attempt to handle multibyte characters correctly. See {excerpt} for other parameters.
Delivers the full post with all relevant filters applied.
The names of the post’s categories, e.g., {categorynames: | } might produce ‘wordpress | plugins’. Note that the separator parameter needs no quotation marks.
As above but with hyperlinks to the appropriate category pages
The ID of a post’s principal category, i.e., if a post has several categories in the same hierarchy it chooses the most specific; if a post has more than one category the first (i.e., numerically smallest) is chosen. This is most useful when posts have only single categories and can be employed, for example, to display specific icons etc.
The number of comments associated with the post. If the extra parameters are supplied different text will be used according to how many comments, e.g., {commentcount:no comments:comment:comments} will give ‘no comments’, or ‘1 comment’, or ‘2 comments’. If the parameters are not supplied a bare numeral is output.
Shorthand for '<a title="{date}" href="{url}" rel="bookmark">{title:maxlength:method}</a>'
The contents of the custom field with the given name. Useful in cooperating with the many other plugins which use custom fields.
The post’s tags. For example, {tags:|} might give ‘wordpress|plugins’. The default separator is ‘, ‘.
The post’s tags as clickable links to the relevant tag pages. The default separator is ‘ ‘.
The number of posts in the blog.
The number of pages in the blog.
The output generated by treating code as genuine PHP. This powerful tag should be used with great care as it allows arbitrary code to be executed. You can, for example, incorporate WordPress template tags or other plugin tags into your output.
Write your code as though echoing to output and be careful to remember your semicolons, e.g.,
{php:$s=' '.strtoupper("hello world").' '; echo $s;}
The {php} has access to the $result object variable which contains the values of the columns of wp_posts for the post in question, e.g., $result-&gt;ID is the post’s ID.
Putting {php:random_posts();} as what to display if no real matches are found provides a fallback display.
You can also include other output tags in your PHP code: just remember that they are not PHP variables but evaluate to literal text and may need to be wrapped in the appropriate quotation marks.
Tries to discover how often a post has been viewed by using any of a number of popular plugins. Let me know if the plugin you use isn’t catered for.
An <img alt="" /> element, if any exists, from a post’s content. By default, the first image is chosen but number can be used to select another (counting from 0 as the first). If width and height are given (as pixels) the image is scaled accordingly, otherwise it displays full size. If the height is omitted width is used to define a square bounding box into which the image must fit. If either width or height is given as ‘?’ the other of the pair is taken as fixed and the image scaled accordingly. The value of timing decides whether the image is extracted before or after WordPress applies its filters to the post content. The default is ‘pre’ but ‘post’ can be specified when, for example, a gallery plugin inserts images only after processing. If the link parameter is given as ‘link’ then only images wrapped in links will be extracted and displayed. Finally, the default parameter can be used to give an <img alt="" /> tag to output if no ne is found in the content.
An image location, if any exists, from a post’s content. By default, the first image is chosen but number can be used to select another (counting from 0 as the first). The value of timing decides whether the image is extracted before or after WordPress applies its filters to the post content. The default is ‘pre’ but ‘post’ can be specified when, for example, a gallery plugin inserts images only after processing. The suffix parameter lets you add a string to the end of the image’s name, e.g., {imagesrc:0::xxx} might return ‘http://path/photoxxx.jpg’ instead of ‘http://path/photo.jpg’. There are two special values of suffix, ‘?t’ and ‘?m’ which use the current settings for thumbnail and medium image sizes to give the name of a reduced image, e.g., {imagesrc:0::?t} might give ‘http://path/photo-150×150.jpg’.
An image tag’s alt attribute, if any exists, from a post’s content. By default, the first image is chosen but number can be used to select another (counting from 0 as the first). The value of timing decides whether the image is extracted before or after WordPress applies its filters to the post content. The default is ‘pre’ but ‘post’ can be specified when, for example, a gallery plugin inserts images only after processing.

In addition, Recent Comments, has the following tags

An excerpt from the comment, applying filters, and stripping tags (apart from smilies if they are activated). For example, {commentexcerpt:20} would give a 20 word excerpt. The default is 55. See {excerpt} for the further parameters.
{commentsnippet:number of characters:method:more:link}
A lightweight extract from the comment, stripped of tags. For example, {commentsnippet:50} gives a snippet 50 characters long. The default is 100. See {excerpt} for the further parameters.
The comment’s date (local timezone). See {date} for parameters.
The comment’s time (local timezone). See {date} for parameters.
The comment’s date (UTC/GMT). See {date} for parameters.
The comment’s time (UTC/GMT). See {date} for parameters.
The comment author’s name. See {title} for parameters
The url left by comment author. See {title} for parameters.
A link to the comment author’s url or, if none was given, just the commenter’s name. See {link} for parameters.
The IP address of the commenter. It can be used, for example, to display an appropriate national flag.
The comment’s permalink as a url.
The url to include in a link to open the comment popup window if the theme allows such.
Shorthand for '<a title="{commentdate} at {commenttime}" href="{commenturl}" rel="bookmark">{commenter} commented on {title}</a>' an alternative to the ‘ commented on ‘ bit can be supplied as the text parameter. The {title} tag is wrapped in a span with class ‘rc-title’ and the {commenter} in a span with class ‘rc-commenter’, so that they can be styled by CSS. <code><code>'

  • {commentlink}

is the default output template for Recent Comments.

Shorthand for '<a title="{commentdate} at {commenttime} on {title}" href="{commenturl}" rel="bookmark">{commenter}</a> - {commentexcerpt}…'.
Displays a globally recognised avatar based on the commenter’s email address. By default, size is 96px. The ‘default’ parameter lets you specify the uri of an image to use when the commenter has no gravatar. Alternatively, you can specify ‘wavatar’, ‘monsterid’, or ‘identicon’ to have an individualised image returned as default.

Similar Posts, has one tag all to itself:

A measure of similarity ranging from 0 to (very) roughly 100 for an identical post.

There is one special tag which can be used in each plugin:

Lets you specify output conditionally according to the boolean value of condition. If condition evaluates to true the value of yes is output, otherwise the value of no. If yes and/or no are not given they default to the blank string. The conditionmust be a valid PHP expression; it can use WordPress or plugin functions; it has access to the $result object giving the contents of the current item’s row of the posts table; it can even contain further output template tags (but only one level of nesting of ‘{}’ is allowed.In addition, yes and no can contain output template tags of their own. For example, you might want to produce different output depending upon whether the current item is a page or a post:
Notice the nested tags with {} within {}. Only one level of nesting is allowed.

Parameter Strings: Overriding the Options Page

Using the Options/Setting page and, in particular, the output template, the behaviour of each plugin can be fine-tuned in many different ways. But what if you wanted to use, say, Similar Posts in more than one place in your blog. You might want to have a comma-separated list of three related posts under each post on your blog’s front page but an unordered list of 5 related posts in the sidebar of your single-post pages. Somehow you need to give each use of the function different instructions.

Let’s start easy. Suppose we have set up our settings page to deliver the three links under each post of the main page. We can just use similar_posts() in the right place to get that effect but then we need to override those options when we call similar_posts in the sidebar. We can override an option by passing a ‘query-string style’ argument list to the plugin template tag, e.g., similar_posts('limit=5') tells the plugin to show 5 items rather than three.

To override more than one option at once an ‘&’ is used. In our case we need to override three options: ‘limit’, ‘output_template’, and ‘divider’ (the full list of option names is given below), i.e.,

  • {link}



Notice that 'divider=' assigns an empty string to the option.

It might happen that you need to specify a value that already contains an ‘&’. In that case you can override the default separator by making the query-string begin with ‘&’ followed by whatever character you want to use in its place, e.g.,
'&amp;|title=Bed &amp; Breakfast|limit=10'.

The full list of parameters is as follows:

the maximum number of posts to show
unique (for Recent Comments only)
show only one comment per post
how many posts to skip before listing
just_current_post (for Recent Comments only)
restrict output to the current post
exclude the current post from output
include password-protected posts (true/false)
include static pages (false/true/but)
include attachment pages (false/true)
include published posts(false/true)
include private posts(false/true)
include draft posts(false/true)
include future posts(false/true)
restrict matches to current post’s categories (true/false)
restrict matches to the current post’s tags (false/any/all)
restrict matches to the current post’s author (true/false)
show_type (for Recent Comments only)
which comments to show (all/comments/trackbacks)
num_terms (for Similar Posts only)
number of words used to generate matches
weight_title (for Similar Posts only)
weight given to title (0.0 — 1.0)
weight_content (for Similar Posts only)
weight given to content (0.0 — 1.0)
weight_tags (for Similar Posts only)
weight given to tags (0.0 — 1.0)
hand_links (for Similar Posts only)
whether to check for manual links (true/false)
term_extraction (for Similar Posts only)
the algorithm to use to get key terms (frequency/pagerank)
what to show if no posts match
no output at all if no posts match (true/false)
text and code before the list
text and code after the list
what to display
text or codes between items
date_modified (for Recent Posts only)
select output by date modified not date created (true/false)
group_by (for Recent Comments only)
how to group list of comments (none/post/author)
what to display before each group of comments
select posts by tag; ‘taga, tagb’ selects posts with either tag; ‘taga + tagb’ selects posts with both tags
comma separated list of post IDs to exclude
comma separated list of post IDs to include
comma separated list of author IDs to exclude
comma separated list of author IDs to include
no_author_comments (for Recent Comments only)
omit comments by the post author (true/false)
no_user_comments (for Recent Comments only)
omit comments by the post author (true/false)
comma separated list of category IDs to exclude
comma separated list of category IDs to include
scan posts for embedded tags (true/false)
how long a time
name of custom field
comparison operator (=,!=,>,>=,<,<=,LIKE,NOT LIKE, REGEXP, EXISTS)
value of custom field
output tag(s) to sort by
‘true’ or ‘false’
output tag(s) to sort by
‘true’ or ‘false’

Extending the Plugins by Adding Your Own Output Template Tags

Let’s say you have another plugin that generates output which you want to include in your recent posts list. It’s actually an easy job–it just means adding a your own code in one place.

Each template tag is defined in the library file /post-plugin-library/output_tags.php as a function with the name ‘otf_tagname‘. So, for example, the {postid} output tag corresponds to the function otf_postid(). The function signature is as follows:
function otf_postid ( $option_key, $result, $ext ) { ... }
where $option_key is the key to the plugin’s options (via get_option()), $result is the particular row of the query result as an object with all the database columns available, e.g., $result->ID or $result->post_title, and $ext is the ‘extra’ data passed along to the tag after the colon. Each output tag function returns the tag value as a string.

Looking over the existing output tags should give you the idea.

705 replies on “Configuring the Post Plugins”

  1. bearded: Sorry but the tag removal works on all snippets or on none 🙁

    I notice that you are not using output template tag parameters correctly in the code above. For example the snippet code you have is
    {snippet:200 method:b more:..}
    but it should be

    The parameters are all decided by where they come in the series of semicolons, not by name. I hope that makes sense.

  2. Really Thanks for indicating the mistake.
    Regarding Tag Removal: Presently no problem! But if I have another Tags to be removed from Snippet, what to do? How it will be included in the Options Page?

  3. Rob: Thanks for the Tips. Can I ask for another one..!
    Presently I am using Random Image plugin. But, I am not satisfied with its limited option. I want to shift to Recent Posts where I get the option of Image with Title/Snippet etc. But can I discard the post in the array, which don’t have Images with it? Is there any option of Cropping Images with a defind Size in Recent Posts?

  4. Rob: Sorry for this second fire continuously! In fact I am facing problem here.. I want to display two (may be more) snippets of two (may be more) different Cats, Skipping the Current Post (Skip One Post) each Cat. I tried this code, but not succeeded:-

    recent_posts('included_cats=4,8&limit=2&skip=1output_template=<a>{title:20 method:trim}</a>{image:0:50:50}{snippet:200:b:..}');

    Pls guide me what to do.

  5. bearded: Let me see if I can answer your questions in order…

    There is no way to drop posts without images. Well, there are two cases I can see and I’m not sure which you mean. It would be relatively easy to not display posts according to a criterion — the {php} tag would do it I think — but then you are left with fewer posts than you asked for. The hard task would be to drop posts and still get the full list of posts which do match your criteria, i.e., having images. It could be done but would involve some rather messy and non general MySQL. If I get time I’ll investigate how messy and non-general.

    Cropping images? No. Images can be resized for display in a number of ways but not cropped.

    Thirdly, if you want two posts for each of two categories you have to do a separate list for each, e.g.:

    recent_posts('included_cats=4&limit=2&omit_current_post=true&output_template=<a>{title:20 method:trim}</a>{image:0:50:50}{snippet:200:b:..}');

    recent_posts('included_cats=8&limit=2&omit_current_post=true&output_template=<a>{title:20 method:trim}</a>{image:0:50:50}{snippet:200:b:..}');

    I have also replaced the ‘skip’ parameter with one to omit the current post which is probably what you want. ???

    I also wonder about the <a>...</a> which seems to have no link destination.

  6. bearded: I take back what I said about your first question. I’ve been playing around for a little while and it seems pretty easy (and extensible) to add the ability to filter posts according to whether they contain certain bits of text. If the text in question is '<img' you can filter for images.

    I’ll play around a bit more and release the new code shortly if nothing goes wrong.

  7. Ciao
    Promised to get back to you when our site’s new front page is in place, so if you like, have a look.
    I wanted
    – a main image that rotates on load or daily basis (used random images)
    – a list of posts in a lefthand sidebare, with an image for the uppermost but not for the rest. Thought I should use your “Random posts” here, but I wanted a list of posts with an image just for the upper. Solution:
    – – XmasB Quotes for the top image and a
    – – Random post list without images below it
    – Below it all a row of images – the two first are Recent posts (the second set to skip 1 – that is, the first post/ to show the second last) – and the rest are fixed images for important parts of the site.
    Now I hope it all works well – even on PCs with Exploder – and that maybe it can be useful for some of you others out there.
    Thanks again for two fine plugins
    – a bit slow due to css tweeking…

  8. Does this plugin only work with front page stories? I have a older story that is shown as the most popular story on my blog according to mint stats, but doesn’t even show up on the popular post section. I check my filter settings, and I can figure out why it wont show up!

  9. How would I attach no follow tags to each one of the links that it creates as similar posts. My site is SEO optimized so even linking between my pages will bleed page rank.

  10. ATLChris:As I’m sure you are aware the plugin has settings to choose just which kinds of pages get counted — if not look under the Other submenu.

    Settings aside, Popular Posts only starts counting viewing numbers from the point of installation so there will be a definite bias at first towards newer posts.

  11. Syd: The {link} output template tag is just shorthand for:
    <a href="{url}" rel="bookmark" title="{date}">{title}</a>
    You can use the fuller form and add in the nofollow and do any other modifications you want.

  12. @Rob, thanks for the info, but I have checked all the settings and i can’t find anything that would cause this post to be filtered out. Also, I have been running the popular post plugin for a few days, and the number one post for the past 24 hours according to my stats doesn’t show up in popular post.

  13. ATLChris: Could you perhaps give me some more information like which post etc. If you submit a bug report from the settings menu for the plugin it will fill me in a little too.

    You are not by any chance running a cache plugin are you?

  14. jorge: Forgive me but I don’t understand. The {postviews} output template tag only works inside the output template of one of the post plugins. If you want to show the number of views directly in your theme you can use the popular_posts_views function.

  15. Thank You ROB,
    But I don’t know how to use the Filter. Will you just guide me writing the code.
    And I am also waiting for.. as you assured “I’ll play around a bit more and release the new code shortly if nothing goes wrong”

  16. bearded: Sorry, I got sidetracked with another project. Since I have to implement the behaviour into each of the post plugins it’ll take a day or two, depending on available energy.

  17. Hello,
    I am trying to use Similar Posts in individual posts and filtering with custom fields.

    My custom field is “articleby”

    I have two authors:
    Sean Nalewanyj
    vince delmonte

    I am inserting this in my post:
    <!--SimilarPosts articleby=Sean Nalewanyj-->

    However, all related articles are shown, not just those of the author.

    The first article: “You Ain’t Squat ‘Till You SQUAT!” is from Sean Nalewanyj, but the other two showing are from vince delmonte.

    Can you help me find what I am doing wrong?

  18. Winagain: You are on the right lines but specifying the custom field to filter by is a little more complex. You have to name the custom field, name its required value and specify their relationship (in this case you want them to be equal). It ends up being a bit more verbose.

    <!--SimilarPosts custom-key=articleby&custom-op==&custom-value=Sean Nalewanyj-->

    If the only way you use Similar Posts in your site is to place lists in individual posts you can put some of that complexity into the general settings, i.e., the custom-key and the custom-op. The the code for the article would be:

    <!--SimilarPosts custom-value=Sean Nalewanyj-->

    An alternative approach which might or might not work for your setup is to use the setting to match the author. That way you could let the plugin use the author information to work out what to show and you wouldn’t have to resort to custom fields. Of course there may be some reason in your case why that is not feasible.

  19. Rob, that did the trick! thanks a lot for your help!

    By the way, I noticed a bug:
    When using in Pages, the configuration in Other/ Look for manual links in custom field? has to be set to “No”, or the links won’t show.


  20. Hi, your plugins are great, but i need help with Popular posts. It works, but i want to show in the single post, how many times was just it viewed and i don’t know how to do it. I tried everything with template tags and such. I mean it like this:

    some text
    the post was viewed 6x.

    Please help, or i’ll have to install wp postviews plugin. Thanks a lot.

  21. as a follow up to my question, i modified teh code of popular-posts.php on line 255:

    // the view counter...
    function pvc_tracker() {
    	global $posts, $current_user;
    	if($current_user->ID != 0){


  22. Adam: The tracker already has the option (set from the ‘Other’ submenu) to exclude views by any users who are logged in. Are you looking for something different here?

  23. Rob: I hadn’t seen that at first, but just checked it and it’s been turned on by default since install apparently.

    it wasn’t working for me – I’m logged in as admin but my post views still affected the ranking.

    this is on WordPress MU, so i imagine that’s the problem?

  24. Thanks for the outstanding plug-ins. Love them. Unfortunately, I’m having the same problem that Simone Brunozzi was having a few months back. Every time I publish a new post a few of the old posts change. I’ll talk a look and see if i can find some sort of connection.


  25. Thanks fora great plugin. It’s working great for me.

    I have one small issue in that it seems to have disabled my AwsomNews plugin which has a ‘%%awsomnews%% ‘ special code for pages/posts. Before I installed your plug in, it was working fine, but now it just displays the ‘%%awsomnews%%

    Is there something I need to close to get it to recognize it again?

    My output is:

    <div style="font-size:11px;"><b>{link}</b><br>
    <div align="right"><a href="{url}">Read more</a></div>

    You can view the work in progress here:

    Thanks for your time and a great plugin.

  26. I’ve been playing around with it, moved it to a different spot on the page, etc, but the only thing that brings back the news announcement is removing the <!--RecentPosts--> tag and of course, I don’t want to do that.

    If I replace <!--RecentPosts--> with the HTML generated, the news announcement displays fine. So it’s not the output itself, but something that must still be open/active during the call to Recent Posts that is not allowing the AwsomNews plug in to be recognized?

    I’m thinking out loud here – I only know enough PHP to harm myself and others 😉

  27. Hello: I have a newspaper site. The plugin works well to show similar posts under every news.
    But, in the index, if I click over of a category (no over the entry) the site shows all posts. Even if I click over another category, the site shows the same (and large) list of post.
    How I to make the plugin list the posts of one category and no all the categories when I choose one of them?


  28. hi there

    I’m struggling a little with the recent posts plugin. I can get it working as default but I’m trying to limit categories and it doesn’t work when I customize the output.

    Here’s what I have:

    With this code, I get the default 5 most recent postings from any category.

    Anyone know why it isn’t working?


  29. Dear ROB, it is just a reminder request. I am still waiting….
    as you told: “Sorry, I got sidetracked with another project. Since I have to implement the behaviour into each of the post plugins it’ll take a day or two, depending on available energy.”

  30. Hi there… I feel really stupid about that, but can’t seem to understand how to use the plugin. All I want to do is to have a page which would display a every comment ever made on the blog, to be used as a guestbook, from the last to the first. But I don’t know where should I insert the code calling for it. I’ve tried to create a page on the wordpress admin interface and simply insert the

    code as a post, but it didn’t work… I’d be really thankful if you could explain me how to do that!

  31. I have try to add the plugin on my WP 2.6.2 easy and work very fine, thanks!
    I call the funcion with but the plug in put only a special character before the title of each post like °

  32. Hi! I’m having trouble inserting the tag in my theme editor. It works fine with my other blogs…not sure what’s up with this one?

    I tried:

    AND this:

    Related posts:

    Both show up as fatal errors! Please, please help…


  33. Hi! It seems there’s some incompatibility issues with AdSense Deluxe plugin. I’ve installed Recent Posts plugin and AdSense Deluxe just stopped functioning.

    With RP disabled – no problem.

    Any idea?

Comments are closed.