Plugin Directory

Contextual Related Posts

Display related posts on your WordPress blog and feed. Supports thumbnails, shortcodes, widgets and custom post types!

If your question isn't listed here, please post a comment at the WordPress.org support forum. I monitor the forums on an ongoing basis. If you're looking for more advanced support, please see details here.

How can I customise the output?

Several customization options are available via the Settings page in WordPress Admin. You can access this via Settings » Related Posts

The plugin also provides you with a set of CSS classes that allow you to style your posts by adding code to the style.css sheet. In a future version, I will be adding in CSS support within the plugins Settings page.

The following CSS classes / IDs are available:

  • crp_related: ID of the main wrapper div. This is only displayed on singular pages, i.e. post, page and attachment

  • crp_related: Class of the main wrapper div. If you are displaying the related posts on non-singular pages, then you should style this

  • crp_title: Class of the span tag for title of the post

  • crp_excerpt: Class of the span tag for excerpt (if included)

  • crp_thumb: Class of the post thumbnail img tag

For more information, please visit http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/

How does the plugin select thumbnails?

The plugin selects thumbnails in the following order:

  1. Post Thumbnail image: The image that you can set while editing your post in WordPress » New Post screen

  2. Post meta field: This is the meta field value you can use when editing your post. The default is post-image

  3. First image in the post: The plugin will try to fetch the first image in the post

  4. Video Thumbnails: Meta field set by Video Thumbnails

  5. Default Thumbnail: If enabled, it will use the default thumbnail that you specify in the Settings screen

The plugin uses timthumb to generate thumbnails by default. Depending on the configuration of your webhost you might run into certain problems. Please check out the timthumb troubleshooting page regarding permission settings for the folder and files.

Manual install

The following functions are available in case you wish to do a manual install of the posts by editing the theme files.

echo_ald_crp()

If you disable automatic display of related posts please add <?php if(function_exists('echo_ald_crp')) echo_ald_crp(); ?> to your template file where you want the related posts to be displayed. You can also use this function to display related posts on any type of page generated by WordPress including homepage and archive pages.

get_crp_posts()

Takes a post ID and returns an array of related post IDs.

Usage: <?php if(function_exists('get_crp_posts')) get_crp_posts($postid, $limit) ?>

Parameters:

$postid : The ID of the post you'd like to fetch. By default the current post is fetched. Use within the Loop for best results.

$limit : Maximum number of posts to return. The actual number displayed may be lower depending on the matching algorithm and the category / post exclusion settings.

Shortcodes

You can insert the related posts anywhere in your post using the [crp] shortcode. The plugin takes two optional attributes limit and heading as follows:

[crp limit="5" heading="1"]

limit : Maximum number of posts to return. The actual number displayed may be lower depending on the matching algorithm and the category / post exclusion settings.

heading : By default, the heading you specify in Title of related posts: under Output options will be displayed. You can override this by specifying your own heading e.g.

<h3>Similar posts</h3>
[crp limit="2" heading="0"]

Requires: 3.0 or higher
Compatible up to: 3.6
Last Updated: 2013-4-26
Downloads: 251,375

Ratings

4 stars
4.2 out of 5 stars

Support

3 of 8 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

1 person says it works.
0 people say it's broken.

100,1,1
100,1,1
100,1,1 100,1,1
100,1,1 100,2,2
100,2,2 100,1,1 100,3,3 100,1,1
100,5,5
83,6,5
67,9,6
100,1,1
100,1,1
100,1,1
100,2,2
100,1,1 50,2,1 50,2,1
100,4,4
100,5,5 100,1,1 100,3,3 100,2,2 50,6,3 0,1,0 0,1,0 0,1,0
75,4,3 100,2,2 100,5,5 50,2,1 100,2,2 100,2,2
100,1,1 100,3,3
100,1,1 100,11,11 100,1,1
75,4,3 100,1,1
100,1,1 100,2,2 75,4,3
50,2,1 100,2,2 100,1,1