WordPress Related Posts Plugin

WordPress Related Posts Plugin generates related posts via the WordPress tags. It then adds the related posts to a feed which can, among things, be displayed at the bottom of all your posts. It will help keep people on your site for longer, and get more of your content viewed.

Installation and Usage:

  1. Upload the WPRP folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Place <?php wp_related_posts(); ?> in your templates
  4. Navigate to Manage Panel > Setting > WordPress Related Posts to configure plugin output.

Download: WordPress Related Posts

Please donate via payapl to support the plugin's development.

WordPress Related Posts

Related Posts

73 thoughts on “WordPress Related Posts Plugin

      • I finally found the the_content(); function and paste after it but then I got:

        Fatal error: Call to undefined function wp_related_posts() in /homepages/../single.php on line 11

        How to correct this error?

        Thanks.

        • OK, I found the error source. Actually I have other Related Post plugin and that was the one that I activated and causing the error. :-) But still can’t make it work. What I got is ‘No related posts’.

  1. I’m having trouble on one of my sites with the plug-in showing only a line of text(the titles of related posts) in the RSS feed and not the list of related links. The only difference in the site from another that does work is that I have removed the php content command from the single post template.
    Any suggestions?

  2. I have 10 related posts display, but want to split it up in 2 columns, 5 posts left, and 5 right, does anyone know how to accomplish this please?

  3. ok, I found out that I should not checkmark
    - Auto Insert Related Posts? in the plugin settings.
    Now it shows as needed, I also added related tags to have Related Posts underneath.
    But another problem occured! There are no Random Posts now under the Related Posts??

  4. Great plugin!! Thanks a lot for developing it.
    Could you please tell me how to change the font color of the “Related Posts Title” and the hyperlinks?

    Thanks!

    SaSh

  5. is there a way of customizing this plugin? In the settings for the plugin you can exclude categories, but I want to embed this plugin in different places with each version excluding different categories, can i do this with a parameter passed into wp_related_posts ?

    I’d also like more info around the thumbnail, I am using p75 simple thumbnail plugin, is it possible to use these are thumbnails for related posts?

    Thank you! Great plugin!

  6. simple but powerfull plugin! i’ll tried this plugin adapt to page which have subpages, but it’s hard for me to do ;) maybe you can help?

  7. I just want to share this piece of css so you can have a nice related post layout with thumbnails. Hope it helps! and thanks for this great plugin!

    Paste it on your style.css

    .related_post a:link {border:none; color:#666666;}
    .related_post {clear:both; text-align:left; margin:10px 0px 0px 0px; padding:0;}
    .related_post li{width:120px; float:left; display:inline; margin-top:5px; margin-right:13px; margin-left:10px; padding:5;}
    .related_post img{width:120px; height:70px;clear:both; padding:5px; background:#F7F7F7; border:1px solid #DDD;}
    .related_post img:hover {border: 1px solid #000;padding:5px;}
    .related_post a{clear:both; display:block; border:none; text-decoration:none;}
    .related_post li{font-size:11px;}
    .related_post li a:hover {color: #000;}

    • i want to change the font style to match my post title, i tried:

      font-family:’palatino linotype’,palatino,’times new roman’,times,serif;

      and this just not change. i change the color and size of the font,
      so i know im the correct area of the style sheet.

      any ideas?

  8. Great plug-in ! A little bit tricky to figure out for non-code guys :(
    But when there is no related posts, It could be nice to display nothing – even the Related Post area – instead of a message “There is is no RP” or most commented/most popular posts.
    I try to do that with CSS property “display: none;” because I’m unable to get into PhP without damage…
    Does anyone knows the trick ?

    • When I pasted after the_content(); function on my single.php, I got two entries with No Related Post. I deleted that line in my single.php, now I got one No Related Post. Don’t know though how to make the related posts to appear there.

  9. hi i was using YARPP earlier but that is cruel for processor usage over shared hosting; resulting in suspension of my blog. Now i am in search of a plugin which is easy on db and doesnt give much load. How abt WPRP?

  10. please help, my posts are showing MASSIVE thumbnails. I was hoping they would show the related and random posts as small thumbnails.

    my site is http://www.bulkhogan.com

    please take a look. when i uploaded the pics and tagged them in i selected “thumbnail”

    thank you. am i gonna have to manually make thumbnails on this?

  11. Please help. I am embarrassingly new. I have uploaded and activated the plug in but am struggling with the part where I have to Place in your templates.

    I am not very sure whether I should be able to do this from the dashboard or the hosting site.
    I could not find this mentioned in an earlier post
    edit single.php,
    find the_content(); function,
    paste after it.

    I am using Thesis 1.7 and the latest edition of word press

  12. hi,
    thanks for the plugin, i really like the way to display random post when there is no relations.
    “”but”"
    i have make a WP template with “artisteer 2.4″ and my site is a “RTL website” and just when i

    activate your plugin i got my site exploded, nothing in its place specially (on IE 7 8) i didn’t test

    it on IE6. (please note that i did not modify the CSS)
    and when i activate the plugin “or” when i put the code manually, i got the same result. i have

    to deactivate the plugin to get the things work fine on both browser.

    you can see what happened at this image
    the original view and Fire Fox view:
    http://i43.tinypic.com/2wqg404.jpg

    the IE view:
    http://i44.tinypic.com/2r43m85.jpg

    any ideas ??

    many thanks in advance.

  13. How exactly is the Exclude (Category IDs) supposed to work. Nothing I am doing is working. Give an example using more than one post to exclude. Write it out:

    Say my category is 27 and my post numbers I want to exclude is 238 and 345….how do I write this in the box so that it works?

    27,238, 27,345 or what? I tried it different ways. Going to have to shut down related posts completely if this will not work.

    Thanks.

  14. Hi Denis,

    I’ve been using your plugin for a week or so, and it’s been working well, but now I have a problem. For some reason, when I log into WordPress and click “Edit” under “Posts” in the left-hand menu, I get a blank page. The page simply will not load, so I can’t see my list of posts to edit them.

    To find out if one of my plugins was causing this problem, I deactivated your Related Posts plugin. Doing this immediately allowed me to view my list of posts on the Edit page, but it also caused everything in my sidebar to diappear, and it gave me this error at the bottom of the first post on the page, where my “related posts” are supposed to be listed:

    Fatal error: Call to undefined function: wp_related_posts() in /homepages/8/d311697663/htdocs/wp-content/plugins/thesis-openhook/functions.php(453) : eval()’d code on line 1

    My theme is Thesis 1.7 and I am running on WordPress 2.9.1. As you can see from the error message above, I’m also using the OpenHook plugin. If you could help me in any way, I would be very grateful!

    • Hi I’m currently trying to fix the same problem as you Amanda (or almost identical because I’m using a different theme). Please let me know if you find a work around. I’m going to try and manually reinstall the plugin files into the directory WP is expecting them to be in for now.

  15. i really had a difficult time figuring out the thumbnail images for this, but after a few minutes of really nosing around my dashboard, discovered how to do it.

    the process involves having a picture related to your post and using the posts “custom field” to display it. i also used the styling from Greg’s comment on this page.

    create the thumbnail – -
    you don’t necessarily need to create this thumb if you already have an image in your post, on the server. let’s say your post is about candy and you have a pic of a sucker on your blog, right click on it, view image. you’ll see the pic appear in a new window. copy the url.

    custom field – - -
    go into your Edit Posts page within WP and scroll down just a bit till you see a section called “Custom Fields”. you’ll see “name” and “value”.

    Enter New.
    Name = I used the word THUMBNAIL.
    Value – paste the url from the step above.
    hit the Add Custom Field button.

    when it comes together, it looks pretty sweet! enjoy! it’s a very good plug-in!

    • Is there any chance to automate this? For example to put the first image in the article to thumbnail?

      best regards,
      Zvonimir

  16. Any ideas on how to display related posts based on custom taxonomies? For example:
    Book related posts use its own custom category, for example “Book”.
    Book related posts also use its own custom tag, for example “book tag”.
    I only want book categorized posts to display related posts with “book tags”.

    Is that possible? Thanks.

  17. Great plugin. Thank you so much. Only thing I can think of that I’d really appreciate would be if you could add classes to the image and text links, as I would like to apply different styles to each.

    So the anchor with the thumb gets a class “related_post_thumb” and the anchor with the text gets a class “related_post_link”. This would make it possible to add a background color to the text, but leave the image as it is. At the moment if you add a style to ‘.related_post a’ it applies it to both.

  18. Dears,

    I’ve installed the plugin and it works just fine!

    But I two small issues that I can not solve:

    1) the settings page does not show a button to save changes, or a “ok” button. So, I can not confirm changes I want to make in the settings.

    2) when I call the plugin in my sidebar, it works fine too, but the title of each post shown goes just one below each other, it is a mess. I should need an additional line break between posts listed. Any tips on how to add that?

    Thanks in advance for any help!

  19. Hi there! This plugin is great!

    To make it greater, you should:

    1) Expose the related posts query to filters, to allow customization:
    Line Number 55:
    [code]$q = "SELECT p.ID, p.post_title, p.post_content,p.post_excerpt, p.post_date, p.comment_count, count(t_r.object_id) as cnt FROM $wpdb->term_taxonomy t_t, $wpdb->term_relationships t_r, $wpdb->posts p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN ($taglist)) AND p.ID != $post->ID AND p.post_status = 'publish' AND p.post_date_gmt term_taxonomy t_t, $wpdb->term_relationships t_r, $wpdb->posts p WHERE t_t.taxonomy ='post_tag' AND t_t.term_taxonomy_id = t_r.term_taxonomy_id AND t_r.object_id = p.ID AND (t_t.term_id IN ($taglist)) AND p.ID != $post->ID AND p.post_status = 'publish' AND p.post_date_gmt < '$now' "; // leave blank space to avoid garbage!

    $q = apply_filters('wp_related_posts_query', $q); // passes query to filters.

    $q .= " GROUP BY t_r.object_id ORDER BY cnt DESC, p.post_date_gmt DESC $limitclause;";[/code]

    2) Allow other plugins (like qTranslate) to parse correctly output:
    Line number 135:

    [code]
    echo $output;
    [/code]

    change to:

    [code]
    echo __($output);
    [/code]

  20. Hello Guys,
    I have a little Problem.

    Before all relatet Posts are >> like in the Categorys in the Sidebar.

    .related_post {list-style-type: none;} is not working.

    What can I do?

  21. How to show a “default” image if one doesn’t exist in the meta field:

    1.) Go to the Edit Plugins screen in WP – you can figure it out. It’s easy.
    2.) Make a copy of all the code for THIS PLUGIN and save it for when you screw up.
    3.) Find line # 85
    4.) Get a suitable image and upload it somewhere and get the URL for it.
    5.) Replace the following code:

    if ($wp_rp["wp_rp_thumbnail"]){
    $output .= 'ID).'" title="'.wptexturize($related_post->post_title).'">ID, $wp_rp["wp_rp_thumbnail_post_meta"], true).'" alt="'.wptexturize($related_post->post_title).'" />';
    }

    With this code instead:


    if ( ($wp_rp["wp_rp_thumbnail"]) && (get_post_meta($related_post->ID, $wp_rp["wp_rp_thumbnail_post_meta"], true)!="") ) {
    $output .= 'ID).'" title="'.wptexturize($related_post->post_title).'">ID, $wp_rp["wp_rp_thumbnail_post_meta"], true).'" alt="'.wptexturize($related_post->post_title).'" />';
    } else {
    $output .= 'ID).'" title="'.wptexturize($related_post->post_title).'">post_title).'" />';
    }

    6.) In the new code you just pasted, replace this URL:
    http://www.YourHost.com/images/default.jpg
    with a URL for the image of your own.
    7.) Click on Update File and see if any errors occur. If so, replace your junk with the backup you copied from Step 2 above and try again.

    I fiddled with this for half an hour. Hope it helps.

  22. Hi,
    the thumbs gets the image from the image custom field. Is there any way to automate the presentation of thumbnail photo. For example to automatically put it from the first image in the post?

    That would be great enhancement…

    Great plugin.
    Best regards,
    Zvonimir

  23. Hey there,
    Love the plugin but not having success excluding “category ID’s” I see another person asked the same question but didn’t find the fix on this page so if anyone has a fix please post. I am currently using the sample of 123, 765, 3,

    Thank you in advance
    Cynthia

  24. Denis – I sent u an email but thought I’d post my question here as not sure what’s the best way to reach u…………..

    Denis –

    Pls help!! I was watching a WP tutorial by Armand Morin and he speaks very highly of this plug-in. I was installing it on a friend’s WP site http://www.wealthyhealthywise.net and got this……….

    Fatal error: Call to undefined function is_site_admin() in /home/reddog/public_html/wealthyhealthywise.net/wp-content/plugins/wordpress-related-posts/related-posts.php on line 81

    Fortunately the site still works but the Fatal error message is the only thing I get when I log into the admin – no dashboard is accessible. What do I need to do and what caused this?

    THXXX!!

    Cindy

  25. i have paste manual,
    but i can’t limit manual. i have replace using
    but this is not work to..
    because iwant dispaly in my post using expert, and in footer no using expert..
    please help me

  26. The “SAVE” buton is not showing on the configuration page on wordpress 2.3. So we can’t SAVE the configuration, so it’s not working. Is there a fix for this?

  27. Thanks for this wonderful plugin. It works very good for me. I only have sometimes the problem that longer post titles are scrambling the display order of the related posts.

    You can see an example of this here: http://www.macfreebies.de/mozilla-thunderbird/

    So, is there a way to modify the plugin code so that it only shows a shortened post titel at the relates post listings?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>