My main gripe with this Plugin is relating to this qTranslate issue. I reviewed the plugin asking if it would be possible to just integrate this three lines of code into the future updates so it plays nice with qTranslate – so we who use multiple languages on this website no longer have to fiddle with the code and add in the patch every time it is updated.
But, regardless, as of the 2.0.2 update, we were again able to patch the plugin similarly to before, and I wanted to share how with anyone else who may be using the qTranslate plugin in combination with this Related Posts plugin:
To patch the latest version of this plugin (v2.0.2) so it works with qTranslate
In wp_related_posts.php
Add the following to line 90:
if(function_exists('qtrans_postsFilter')) :
$related_posts = qtrans_postsFilter($related_posts);
endif;
This ends up appearing like this (between the lines of code shown):
}
function wp_rp_fetch_posts_and_title() {
$options = wp_rp_get_options();
$limit = $options['max_related_posts'];
$title = $options["related_posts_title"];
$related_posts = array();
wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts_v2');
wp_rp_append_posts($related_posts, 'wp_rp_fetch_related_posts');
wp_rp_append_posts($related_posts, 'wp_rp_fetch_random_posts');
if(function_exists('qtrans_postsFilter')) :
$related_posts = qtrans_postsFilter($related_posts);
endif;
return array(
"posts" => $related_posts,
"title" => $title
);
}
Hopefully the developer will consider making this patch in his future updates. I know he’s working for free though – and that can be difficult. My company is planning to donate to all the plugin developers whose plugins we are currently integrating into our new website. I encourage all of you to consider donating to these developers as well. Especially if you use it for your business websites!