Yet Another Related Posts Plugin

Donate to mitcho (Michael Yoshitaka Erlewine) for this plugin via PayPal

by mitcho (Michael 芳貴 Erlewine) for WordPress.

< return to main documentation

Manual installation

This is an advanced feature for those comfortable with PHP. 97% of users will be better served by the auto display options above.

If you would like to put the related posts display in another part of your theme, or display them in pages other than single entry pages, turn off “auto display” in the YARPP Options, then drop related_posts(), related_pages(), or related_entries() (see below) in your WP loop. Change any options in the Related Posts (YARPP) Options pane in Admin > Plugins. See Examples in Other Notes for sample code you can drop into your theme.

There’re also related_posts_exist(), related_pages_exist(), and related_entries_exist() functions, which return a boolean as expected.

The related_ functions

By default, related_posts() gives you back posts only, related_pages() gives you pages, and there's related_entries() which gives you posts and pages. When the "cross-relate posts and pages" option is checked in the YARPP options panel, related_posts(), related_pages(), and related_entries() will give you exactly the same output.

The related functions can be used in conjunction to the regular "auto display" option.

© 2006-2010 mitcho (Michael 芳貴 Erlewine).
The views expressed on these pages are mine alone and do not
reflect those of my employers and clients, past and present.