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.
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
For more information, please visit http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/
The plugin selects thumbnails in the following order:
Post Thumbnail image: The image that you can set while editing your post in WordPress » New Post screen
Post meta field: This is the meta field value you can use when editing your post. The default is
First image in the post: The plugin will try to fetch the first image in the post
Video Thumbnails: Meta field set by Video Thumbnails
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.
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( $args = array() )
Echoes the list of posts wherever you add the this function. You can also use this function to display related posts on any type of page generated by WordPress including homepage and archive pages.
<?php if(function_exists('echo_ald_crp')) echo_ald_crp(); ?> to your template file where you want the related posts to be displayed.
Takes a post ID and returns the related post IDs as an object.
<?php if(function_exists('get_crp_posts_id')) get_crp_posts_id( array( 'postid' => $postid, 'limit' => $limit ) ); ?>
$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.
You can insert the related posts anywhere in your post using the
[crp] shortcode. The plugin takes three optional attributes
cache as follows:
[crp limit="5" heading="1" cache="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"]
cache : Cache the output or not? By default the output will be cached for the post you add the shortcode in. You can override this by specifying
The plugin includes the following filters that allows you to customise the output for several section using add_filter.
crp_heading_title : Filter for heading title of the posts. This is the text that you enter under Output options > Title of related posts
crp_title : Filter for the post title for each of the related posts
I'll be adding more filters eventually. If you are looking for any particular filter do raise a post in the support forum requesting the same.
Requires: 3.0 or higher
Compatible up to: 4.0
Last Updated: 2014-5-10
11 of 22 support threads in the last two months have been resolved.
Got something to say? Need help?