mitcho Michael 芳貴 Erlewine

Linguist. Fifth year PhD student at MIT.

blog

Using Templates with YARPP 3

I am no longer maintaining the information here. It is out of date. Please see the Developing with YARPP section of the YARPP readme.

If you have a YARPP support question not directly related to the templating feature, please use the YARPP support forums.

Version 3 of Yet Another Related Posts Plugin is a major rewrite which adds two new powerful features: caching and templating. Today I’m going to show you how you can use templates to customize the look of your related posts output.1

Previously with YARPP you were relatively limited in the ways you could present related posts. You were able to set some HTML tags to wrap your posts in and choose how much of an excerpt (if any) to display. This limited interface worked great for many users—indeed, these options still exists in YARPP 3.0. However, there’s also a new option for those of you who want to put your PHP skills to work and have complete control over your related posts display. The option will let you choose any files in the templates subdirectory of YARPP.

templates interface

The structure of a YARPP template

Let’s take a look inside the example template, included with YARPP 3 (yarpp-template-example.php):

  1. <h3>Related Posts</h3>
  2. <?php if (have_posts()):?>
  3. <ol>
  4. 	<?php while (have_posts()) : the_post(); ?>
  5. 	<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
  6. 	<?php endwhile; ?>
  7. </ol>
  8. <?php else: ?>
  9. <p>No related posts.</p>
  10. <?php endif; ?>

There are two basic parts to this (and most all) YARPP template: (a) what you display when there are related posts and (b) what you display when there aren’t. We make this switch with the conditional on line 6. If there are related posts, we introduce an ordered list and use the while loop to loop over all the related posts. For each post, we use the snippet the_post(); to load the appropriate post data, then print the line item.

You’ll notice that we’re using familiar template tags here such as the_permalink() and the_title(). If you’ve ever had to tweak or build a WordPress theme before, you’ll immediately feel at home. I’ll touch on this again later.

The power of PHP

One big advantage of this new templating system is that you can control exactly how the posts are listed, breaking out of all of the previous structural limitations. For example, in the template-list.php template, we put the information for each related post in an array and then concatenate the strings with implode. This way, we produce a comma-separated list for our readers without any stray commas before or after the list, which was impossible until now.

  1. $postsArray = array();
  2. while (have_posts()) : the_post();
  3. 	$postsArray[] = '<li><a href="'.get_the_permalink().'" rel="bookmark">'.get_the_title().'</a></li>';
  4. endwhile;
  5.  
  6. echo implode(', ',$postsArray); // print out a list of the related items, separated by commas

You can also run any arbitrary PHP in the template file—even roll another WP_Query, as in the case of template-random.php, where a random post is returned when there are no related posts.

Familiar template tags

As mentioned before, the tags we use in these YARPP templates are the same as the template tags used in any WordPress template. In fact, any WordPress template tag will work in the YARPP Loop. You can use these template tags to display the excerpt, the post date, the comment count, or even some custom metadata. I’ve also written two special template tags which only work within a YARPP Loop: the_score() and get_the_score(). As you may expect, this will print or return the match score of that particular related post.

In addition, template tags from other plugins will also work. For an example, take a look at the yarpp-template-photoblog.php file:

  1. <?php while (have_posts()) : the_post(); ?>
  2. 	<?php if (function_exists('yapb_is_photoblog_post')): if (yapb_is_photoblog_post()):?>
  3. 	<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php yapb_get_thumbnail(); ?></a></li>
  4. 	<?php endif; endif; ?>
  5. <?php endwhile; ?>

In this template’s YARPP Loop, we use some template tags introduced by the Yet Another Photoblog plugin. If you have the Yet Another Photoblog plugin installed, you can use this template to display thumbnails of related posts in lieu of the titles. Notice that here we’re checking first whether each related post is indeed a photo post or not using yapb_is_photoblog_post() and then using the Yet Another Photoblog yapb_get_thumbnail() template tag to get the location of the thumbnail.

Templating in YARPP 3.0 enables the blog admin to uber-customize their related posts display using the lingua franca of PHP and template tags. Feel free to comment here with ideas, comments, and of course links to your YARPP-powered blogs. I look forward to seeing what the WordPress community does with this new feature!


  1. For those of you interested in the WP and SQL voodoo used to make this happen, I’ve posted a more technical article

Tags: , , , , , , ,

If you enjoyed this post, make sure you subscribe to my RSS feed (optionally with tweets from my Twitter)!

113 Responses to “Using Templates with YARPP 3”

  1. Edward Harrison Says:

    Mitcho, thanks for explaining this. I have been testing a number of related post plugins on my blog and I like yours the best because I can tweak the algorithm to suite my needs. I have been having problems with CPU usage, however, as I have 1500 posts and 250 tag names. I look forward to seeing how the caching feature improves things.

    For others looking to test this, you might try using a plugin called WP-Tuner. It has been helpful in identifying which plugins are creating difficulties or conflicts.

    One question I have is whether Simple Tags, with the related tag feature turned off will conflict with YARPP. Let me know, Mitcho, because I like Simple Tags for its tag management and mass editing capabilities.

  2. mitchoyoshitaka Says:

    @Edward - I have to admit, YARPP < 3 has been a nightmare for some larger / higher-traffic blogs, really making this caching feature a necessity. I hope you can try out the beta and verify that the caching works well.

    As for Simple Tags and YARPP… while I don't use Simple Tags myself, I do know users who use YARPP with Simple Tags (with the related tag feature off). I don't know anyone who's tested it with YARPP 3 yet, but I don't see why it would be a problem.

  3. Alain_Thomas Says:

    Hi very noce work i'm now testing beta and translating it into french

    Regards

  4. mitchoyoshitaka Says:

    Alain, I'm sorry but we already have a French translator. If you email me I'll let you know if I ever need someone else to take over. Merci. ^^

  5. Asger Says:

    This release of YARPP is a perfect fit for the Yet Another Photoblog (YAPB)-plugin. I did a fast, rough implementation on my own danish blog (http://tegneblog.dk/2008/kvinde-med-haandtaske.ht…I have been waiting for a thing like this for ages. @Mitcho - Thank you again!

  6. alta Says:

    I use your new YARPP to call plugins and have a little error, after trial and error i found the problem, i change the php code from <li><?php yapb_get_thumbnail(); ?></li> to <li><?php echo yapb_get_thumbnail(); ?></li>

    and it works

    sorry for my bad english

  7. mitchoyoshitaka Says:

    Thanks alta. I'll make sure to put that fix in the next beta. :)

  8. Edward Harrison Says:

    I have been using the caching feature and it works incredibly well. This is a great improvement. The initial caching took about 20 minutes for the 1500 posts. Afterward everything was as it had previously been. But now CPU usage is way down and it works marvelously. I have seen a good increase in my pageviews per user as a result. Thanks for the upgrade. I can't say enough about it.

  9. mitchoyoshitaka Says:

    I'm glad to hear that Edward! Thanks for letting me know.

  10. Klaus and Cakes Says:

    Hi Mitch,
    We love your plugin, it gives the best results of any of them, and we have the latest beta sucessfully working on our site

  11. Elpie Says:

    Just testing the beta out now Mitcho and I noticed that the introduction message says "Thank you for upgrading to YARPP 2. YARPP 2.0 adds the much requested ability to limit related entry results by certain tags or categories. 2.0 also brings more fine tuned control…"
    You might want to change this to YARPP 3 ;)

  12. Elpie Says:

    On WP 2.6.5 I am getting this error: "The YARPP database has an error which could not be fixed." The cache is also not being built. Is YARPP 3 written for WP 2.7 only? I hope not because I hate 2.7 and will not be upgrading.

  13. mitchoyoshitaka Says:

    Thanks for trying out the 3.0 beta. I just released a new version (3.0 beta 2) which fixes that first message issue, and may (perhaps) fix the second. I'd appreciate your feedback. :D

  14. Richard Says:

    Great plugin, but any possibility of showing a thumbnail of the post as an option? Pull first image in post and cache all thumbs, give options for 32px/64px images. Images speak SOOO loudly! Thanks

  15. mitchoyoshitaka Says:

    Hi Richard,

    This is indeed possible with a custom theme… you'd have to make a template file which gets the content and parses it to find the first image… this should not be hard, using a regular expression.

    My plan with the templating feature is to give the user enough freedom to display their results exactly as they like, so I don't have to add such options into YARPP itself. The more options, the harder to use the plugin becomes.

  16. Kyhos Says:

    Don't work filters options:

    $related_query->query("orderby=name&order=desc&limit=3"); if ($related_query->have_posts()): while ($related_query= new WP_Query()) : $related_query->the_post();

    or

    $related_query= new WP_Query("orderby=name&order=desc&limit=3"); if ($related_query->have_posts()): while ($related_query= new WP_Query()) : $related_query->the_post();

    Example full use (but don't work):

    If ($related_query->have_posts()): While ($related_query->have_posts()) : $related_query->the_post();

  17. <?php the_title(); ?><!— (<?php the_score(); ?>)—>
  18. <?php endwhile; else: //no related posts $related_query->query("orderby=name&order=desc&limit=3"); if ($related_query->have_posts()): while ($related_query= new WP_Query()) : $related_query->the_post(); ?>
  19. <?php the_title(); ?>
  20. <?php endwhile; endif; endif; ?>

  21. mitcho Says:

    Hi Kyhos—you're right. You can't use a query string to filter your results in a YARPP template. What are you trying to do?

  22. Vu Tong Says:

    Thanks for releasing this beta! Certainly helps in making my related posts looking way better.

  23. mitchoyoshitaka Says:

    Thanks Aaron. It's corrected in beta 5.

  24. James Says:

    I've noticed two things. First in Beta 5, I cannot select an template to use; the select menu is blank. In Beta 4, my posts do not relate without me manually rebuilding the cache. What do you think the problem is?

  25. mitcho Says:

    James, please take a look at the install instructions file. You most likely don't see any templates because you haven't copied the yarpp-templates folder to the right location yet (with beta 5, that's in <code>wp-content/</code>). As for the cache, you must either build the cache yourself or else turn on the "cache on the fly" option which is safe for most small to medium size blogs.

  26. Matt Says:

    Hello, I've got the beta 5 installed and the templates are displaying, however I'm trying to get the custom image to display but it does seem to process the following fucntion: <?php echo $custom_field; ?>

    Basically that code should echo the custom image url of my post. It works in other places in my WP loop, but it just disappears when I place it in yarpp template file.

  27. mitcho Says:

    Hi Matt—I don't think the $custom_field method is supported in general… are you using some plugin to enable that?

    The supported custom field methods are described here… for example, please use the <code>get_post_meta()</code> function.

  28. James Says:

    So for every new post you create it wont' be included in the cache until you manually rebuild? Or if you do the compute on the fly?

  29. mitcho Says:

    James, great question. No, for any post which you write after YARPP is activated, it will compute its related posts cache entry whenever you save that post/page. I suppose that should be explained in the FAQ or something…

  30. James Says:

    Then what does the cache on the fly do differently? :)

  31. mitcho Says:

    James - the "on the fly" caching kicks in when a viewer accesses a page whose related posts haven't been cached. If the option is off and an uncached page is visited, they will see "no related posts."

    If you have built your related posts cache once, then it shouldn't matter whether you have the on the fly cache on or not.

  32. Cirurgia Plastica Says:

    I loved the plugin. So far i hasnt seen any bug in my blog. The plugin is working perfectly!

  33. Dave Wild Says:

    This is marvellous! I'm so glad there are talented people out there creating this! :D I thought getting related thumbnails presented nicely was going to be a nightmare - this template system is great, I managed to re-use some of my archive page to keep the look consistent with the rest of the site.

    So, thank you again! :)

  34. Callum Says:

    Good job, your plugin is fantastic- the work that's gone into it (backend is near perfect) makes me happy to be in the WordPress Community! Your plugin has made my blog work again, and given me inspiration to sort out my own plugin. Thank you!

  35. Sven Says:

    Is there a way to display thumbnails without the YAPB plugin? How could i accomplish this :)

  36. mitcho Says:

    I know there are other plugins which create thumbnails of images in posts, e.g. the Post Thumbs plugin. Template tags from those plugins should also work in a YARPP template. ^^

  37. Patrick D. Says:

    Okay, I updated and now I just get this: wp-content/plugins/yet-another-related-posts-plugin/magic.php on line 300. I've configured according to your instructions. Help? Also, how will this work with the WP Mobile Edition plugin? Thanks.

  38. Alison Says:

    Same problem here… I updated to the latest version this morning and now get this error: wp-content/plugins/yet-another-related-posts-plugin/magic.php on line 300. (Things were working fine before.)

    I went in and looked at line 300, but I'm not exactly sure what the fix is. Any help is much appreciated. Thanks!

  39. julien Says:

    Hello, Thank you for your script, it's working fine. I'm still searching to put the thumbnail next to the entry. Can you help me ? Thanks Julien

  40. mitcho Says:

    Patrick, Alison, I believe I've fixed this issue with version 3.0.1. Please try it out.

  41. mitcho Says:

    Hi Julien—as I said to Sven above, you may want to check out the Post Thumbs plugin.

  42. KGG Says:

    Same problem as Patrick D. I have the flexibility theme and this update doesn't seem to work with it.

    How do we fix it?

  43. mitcho Says:

    Please note that I already replied to Patrick D above. This is fixed in the patch, version 3.0.1. Please get it from wordpress.org.

  44. Patrick D. Says:

    It did work. I had to do the 'save options' thing even without changes, but it is working again. Thanks.

  45. Patrick D. Says:

    It did work. I had to do the 'save options' thing even without changes, but it is working again. Thanks.

  46. julien Says:

    Yes, I know but I use one other plug to put thumbnail on my website and I'm not to install one other plugin. I have more of 150 articles and few autor and I don't think that it's will be easy to change all. Unfortunatly, I don't know php and I'm not able to joint the thumbnail in your template code. Anyway, thank a lot for your code Julien

  47. julien Says:

    Hello ! I search, I search and I succed to put the thumbnail but it miss someting, the images are not resizes, they are full resolution. Here is my code, can you help me please : <?php /* Example template Author: mitcho (Michael Yoshitaka Erlewine) */
    ?><h3>Related Posts</h3> <?php if ($related_query->have_posts()):?>

      <?php while ($related_query->have_posts()) : $related_query->the_post(); ?> <div class="post-thumb"><?php show_thumb($options['GTwidth'],$options['GTheight'],$options['crop'],$options['quality']); ?></div>
    1. <?php the_title(); ?><!— (<?php the_score(); ?>)—>
    2. <?php endwhile; ?>

    <?php else: ?>

    No related posts.

    <?php endif; ?>

  48. icono Says:

    Thank you for your plugins, but i have some problem with display thumbnail: http://www.hurl.ws/2dxd
    what could the problem be? Thanks

  49. mitcho Says:

    Sorry, that seems like a YAPB problem… I don't think I can help you. :/

  50. Conquest Authority Says:

    HI Mitcho,

    Thanks a lot for this plugin. I've tried many other related post plugins but I like your's the best and it works great.

    I never had any problems with it.

    Daniel

  51. ScottProck Says:

    I'm really enjoying this plugin, after I get all the basic tweaks finished up I will start looking for ways to utilize the templating system.

    Thanks for such great work … Scott - @ScottProck

  52. zabo Says:

    it would be wonderful if you could post a way to insert a thumb in the plugin…i think many people are waiting to be able to do that without being ph experts. help!!!!1

  53. mitcho Says:

    Do you mean you'd like to display thumbnails of related posts? You can use template tags from plugins in your YARPP templates.

    Have you tried the Post Thumbs plugin? You can use those template tags in your YARPP template.

  54. Giang Says:

    Thanks for a nice plug-in and keep it up.

  55. Essay Writing Says:

    Thank you for your script, it's working fine.

  56. FlatwareMedia Designs Blog » Blog Archive » Yet Another Related Posts Plugin Says:

    […] The display can also be changed by editing the YARPP templates.  See tutorial here. var addthis_pub = ‘flatwaremediacom’; var addthis_language = ‘en’;var addthis_options = ‘email, favorites, digg, delicious, myspace, google, facebook, reddit, live […]

  57. Funny SMS Says:

    This plugin is so amazing. I have been using similar post plugin for sometime now but after moving to YARPP, I am so relaxed. Its so easy to use and it has all the features I wanted :)
    Thank you so much.

  58. erol Says:

    Ok. this is god but what do I do if I want to show related posts somewhere else like in the sidebar?

  59. mitcho Says:

    You can customize the display to add some CSS tags which can then be used to place the content on the page as you see fit. If you need the related posts display in a different place in the page, see the manual installation page which will explain where to put the display in a different part of the page.

  60. erol Says:

    Great, Thank you very much. Much appreciated.

  61. John Says:

    Mitcho,

    Been using YARPP for about a year. Love the new cacheing feature. One question about how it works. After I build a cache, when new posts are created on my blog, will their related entries be cached automatically? It seems like this should be happening, but I can't tell if it is.

  62. mitcho Says:

    John, yes it does. It also must update the caches of posts related to it, so here's what happens.

    You make a new post, post 100. It computes its related posts, and learns 100's related to 12, 52, and 93. It then goes and rebuilds the caches for 12, 52, and 93 as well. In this way, if 100 ought to show up in those previous articles' related posts lists as well, it will do that.

    In this way, only under very rare circumstances will you have to manually rebuild the cache. Thanks for the great question.

  63. John Says:

    That's great. Thanks for making this.

  64. Fixing Geshi on line 2132 Says:

    […] I recently noticed that some of my blog posts, most notably my Templates in YARPP 3 article, was producing a PHP error: […]

  65. slym Says:

    I really loved your plugin just installed it on my website. I hope it will generate great results. Thanks for the nice plugin.

  66. Mario Says:

    Thank you, works fine, i like this Plug-In - Great work!

  67. Связанные записи в WordPress – Yet Another Related Posts Plugin | Блог Сергея Т Says:

    […] Подробнее про шаблоны можно прочесть здесь: http://mitcho.com/blog/projects/yarpp-3-templates/ […]

  68. tips paid review Says:

    i'm still not understand how to custumize it

  69. Patrick Says:

    Hey, Some how I found a snippet of code that would actually display the excerpt within the YARPP templates. I've since re-installed and lost the snippet… It did not seem complicated but I can not remember what it was. anyone doign somethign similar and would like to share?

  70. mitcho Says:

    Try the_excerpt(). You can check out the full list of template tags here: http://codex.wordpress.org/Template_Tags

  71. Patrick Says:

    so I am FAR from a coder…. barely even one in training! :)

    Like this? (in front of href?) I didn't have any luck with this method, see http://plramsey.com/smart-business/management-les

    <?php if ($related_query->have_posts()): $postsArray = array(); while ($related_query->have_posts()) : $related_query->the_post(); $postsArray[] = '<?php the_excerpt(); ?> '.get_the_title().'<!— ('.get_the_score().')—>'; endwhile;

    echo implode(', '."n",$postsArray); // print out a list of the related items, separated by commas

    else:?>

    No related posts.

    <?php endif; ?>

  72. mitcho Says:

    For starters, it would be easier if you were to use yarpp-template-example.php rather than yarpp-template-list.php…

  73. Patrick Says:

    like this?

  74. <?php the_title(); ?><?php the_excerpt(); ?>
  75. mitcho Says:

    yeah… does it work?

  76. Michael Says:

    Can I exclude related posts from showing up in a particular category. I have a category for asides, which appear in the sidebar, and don't want related posts to appear there.

  77. mitcho Says:

    You should be able to do this by manually entering related_posts() in your template and wrapping that in a conditional:

    if (!in_category('no-related-posts')) related_posts();

    Hope that works. :)

  78. Dave Says:

    To michael - you go to the wordpress settings - related posts (yarpp) - "the pool" and you choose categories over there.

  79. Alex Sysoef Says:

    Thanks for the great plugin and now it is even more useful

  80. wordpress yet another related posts plugin plugin  Blog Reviews Says:

    […] templating mechanism. More information is available in this tutorial. […]

  81. sam Says:

    i want to manually place related posts in single.php, can anyone give me the code to do so.

    I tried everything but nothin seems to work.

  82. mitcho Says:

    Sam, there are instructions here but the bottom line is that the code you want is <code>related_posts()</code>. Put that PHP code in your single.php Loop.

  83. Michelle Klare Says:

    Hi, Nice post! You have worked hard on jotting down the essential information. Keep sharing the good work in future too.

  84. sears coupon codes Says:

    I think I found a bug in YARPP 3.0 beta 4 if you haven't already found it. If you look at your includes.php

  85. Tesco voucher codes Says:

    Every other mention of this table in your plugin includes the prefix, except for the create. Changing the table create statement to: {$wpdb-&gt;prefix}yarpp_related_cache fixed everything for me.

  86. Nigel Says:

    Excellent plugin - thanks. My pHp skills are somewhat limited. Is there a way to show the related posts and sort them by category putting 'Category' into some kind of format? Thanks again.

  87. mitcho Says:

    Unfortunately there's no simple way to do that with YARPP at this time.

  88. Matthias Pospiech Says:

    I tried to use the related list in a box of a landingsite plugin (only called if the visitor was comming from a search engine).

    However if I do that the webpage stops at the point of the first php code of this plugin. I used only this :

    <?php if ($related_query->have_posts()):?>

      <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
    1. <?php the_title(); ?>
    2. <?php endwhile; ?>

    The code is inside the loop. Funnywise, at the end the related list works perfectly.

  89. Matthias Pospiech Says:

    I tried to use the related list in a box of a landingsite plugin (only called if the visitor was comming from a search engine).

    However if I do that the webpage stops at the point of the first php code of this plugin. I used only this :

    <?php if ($related_query->have_posts()):?>

      <?php while ($related_query->have_posts()) : $related_query->the_post(); ?>
    1. <?php the_title(); ?>
    2. <?php endwhile; ?>

    The code is inside the loop. Funnywise, at the end the related list works perfectly.

  90. Michael Lawrence Says:

    Hi, This is great work and very good information. This post will really help beginners, although it is basic but, it will help others in great deal in future.

    Buy Dissertation

  91. Michael Lawrence Says:

    Hi, This is great work and very good information. This post will really help beginners, although it is basic but, it will help others in great deal in future.

    Buy Dissertation

  92. mitcho Says:

    Matthias, inserting the template code directly will not work. You must simply insert <?php related_posts() ?> in your template code and then edit the display using a YARPP template (as described in this post).

  93. Yagiz Gurgul Says:

    I can't see my templates files. It's blank. What is the problem? ( I have latest version installed )

  94. Sumeet Chawla Says:

    This is a very interesting plugin and am going to use this instead of my old plugin :P Thank you very much for creating it !

  95. kitchen renovation Says:

    Hi, Great plugin.
    I had a couple of issues setting it up, but now it works perfectly Very useful Love it

  96. Free Download Says:

    Have been using this plugin since the first time blogging. The custom template feature is really great. Really appreciate for the hard work. Thanks

  97. gazduire Says:

    Thanks, good works… bravo! :)

  98. Eric Says:

    I have a wordpress site with constant feed of shopping items. I would like a side bar widget to show seasonal offers such as Christmas product posts. Is there a plugin or bit of code to achieve this easily?

  99. mitcho Says:

    There may be, but YARPP would not be what you want. Try checking http://wordpress.org/extend/ .

  100. mitcho Says:

    Is it one of the bundled templates or a custom one?

  101. Lorem ipossum opossum « gavia . gráfia Says:

    […] Templating: New in 3.0! A new templating system puts you in charge of how your posts are displayed. […]

  102. Wordpress Plugin: Yet Another Related Posts Plugin | HiTechBlog Says:

    […] Templating: New in 3.0! The YARPP templating system puts you in charge of how your posts are displayed. […]

  103. Must Have SEO Plugins for Wordpress - Wordpress Geeks Says:

    […] Templating: New in 3.0! The YARPP templating system puts you in charge of how your posts are displayed. […]

  104. Kurt Williams Says:

    I am trying to use filezilla to move the template files to the wordpress theme folder. Will you please explain this in detail as if you were trying to teach a child? I don't get it. I have tried uploading the files from my desk top, I have tried dragging them directly from the right side of filezilla into the wordpress theme. I have double clicked on that wordpress theme to find another file with the theme's name on it and tried uploading and dragging it into that file and nothing makes a difference, except I now get this message:

    No YARPP template files were found in your theme (/home/kurtwill/public_html/myssite.com/wp-content/themes/republic/republic) so the templating feature has been turned off.

    Kurt

  105. mitcho Says:

    What you want to move to your theme’s folder are the files which are named yarpp-template-....php rather than the yarpp-templates folder itself. I hope that helps.

  106. Wordpress相关文章插件Yet Another Related Posts Plugin - 大海个人网站 Says:

    […] 修改说明(不过是英文的,英文好的朋友可以去参考一下):http://mitcho.com/blog/projects/yarpp-3-templates/ […]

  107. Source astrology Says:

    Thanks Mitcho for providing a really great tool and now with the updated version, it seems to be even better.

    Unfortunately I was also one of the ones who didnt understand how to get the thumbnails to work and am not a PHP expert and I couldnt quickly find the information here relevant for a total newbie. So, I did a search on Google and found a site which gives step-by-step instructions and voila, the thumbnails showed up. It was just a matter of creating a new PHP with the code they gave and adding CSS to the stylesheet.

    Of course you still need a thumbnail generator (I use timthumb) and have the path for the thumbnail image in the page/posts in order for the image to display, plus you have to select the template you want to use in the settings for YARRP. They have screenshots and all the information needed to do this properly.

    Anyway, I found the information on this page totally useful, without which I had no clue how to make it work. Just thought I would share it so that others could benefit too (hope it's okay to post): http://archondigital.com/studio/wordpress/plugins

    And I have no affiliation with this site, just found it incredibly useful for me and thought that others would benefit too, as it provides step-by-step instructions for total PHP newbies like me to enable the thumbnails to work. And now they do and it looks really good!

  108. mitchoyoshitaka Says:

    Thanks for the link. Looks great!

  109. Waralaba Says:

    Great plugin. Is there anyway to put the related posts list on wordpress sidebar ? Is there any widget for this ?

  110. mitcho Says:

    A “Related Posts” widget is included with the plugin.

  111. ac3filter download Says:

    I was already using timthumb.php on my theme to generate post thumbnails and using it on the related posts loop made it much easier as I only have to specify one custom field for all my thumbnails

  112. bagosbanget Says:

    Yes, i upgraded and there was a notification : "The plugin generated 896 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin." Is it related with template with yarp3?

  113. mitcho Says:

    This was fixed with version 3.1.9. :)

  114. Making it Lovely | Transforming the so-so. » Blog Archive » Adding Related Posts Says:

    […] Then I began working on a custom template, delving into the PHP. […]

  115. Tiger Says:

    Fantastic Work - Really great stuff - also got the error about headers but everything seems to be working fien though

    well done - will be donating for sure

  116. Jo Graphiste Says:

    Thank you for this nice script. I'ma try it on my new WP website. :) But I think this is a little bit advanced for me, my developer will do it for me. :)

  117. Agus Suhanto Says:

    YARPP is the one of the plugins I never deactivate since I use it. It is very effective in retrieving related posts. Related with templating, I have create a sample of YARPP template that uses post-thumbnail or featured image feature of WordPress >2.9. The thumbnail is also overlaid with title post on top of transparent background. Here is the implementation details: http://suhanto.net/yarpp-template-post-thumbnails….

    I hope it is useful!

  118. Puscifer Says:

    Hi, Great plugin you have here!!!! I used it and works like a charm. Rated: 5stars!