After receiving overwhelming responses to the first release of the Related Posts plugin for WordPress, I have tried to implement a range of new features as requested by my loyal commenters.
The 2.0 release wil bring these new features:
- Option to display related posts underneath your post content automatically
- Extended customization of the way the list of related posts are displayed:
- Using a custom title for the related posts section
- Choosing the HTML header element (h1, h2, etc.) of the title for the related posts section, for all you DOM purists and SEO cats out there
- Custom message to display when there are no related posts, with the option no displaying anything at all (no text, no code)
- Widget support
- Some minor bugs, like the post itself appearing as a search result
- [EDIT] Relating posts to pages and vice versa will also be a feature in this release
Note that this version is a release candidate, which means that it’s not yet fully tested. That’s why I need you to check it out.
Please download the plugin, take it for a spin and let me know if you run into anything unexpected. If everything goes well, I will officially release version 2.0 to the world somewhere next week.
- For customizing with CSS: the list will be displayed as a
<ul>within a container
- Place this code in your template files (probably single.php) where you want the list of related posts to be displayed:
<?php MRP_show_related_posts(); ?>
- To get the output HTML without displaying it use this function:
<?php $related_posts_html = MRP_get_related_posts_html( $post_id ) ?>
- If you’re looking for further integration; this function will return the IDs and titles of related posts:
<?php $related_posts = MRP_get_related_posts( $post_id ); ?>It will return an array like