Title: [Plugin: Yet Another Related Posts Plugin] Get related posts as array
Last modified: August 19, 2016

---

# [Plugin: Yet Another Related Posts Plugin] Get related posts as array

 *  Resolved [Ahaenor](https://wordpress.org/support/users/ahaenor/)
 * (@ahaenor)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/)
 * Good day, Mitcho!
 * First of all, thnx for your wonderful work.
 * Can i somehow get the related posts as array, returned from related_posts() arguments(
   or just given post’ id)?
 * There’s been question like mine earlier, but you answered via email.

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192177)
 * [@ahaenor](https://wordpress.org/support/users/ahaenor/) – No, this is not currently
   possible in a direct manner, but you can do this by looping through the related
   posts in a YARPP template and then putting each posts’ data into an array. I 
   have an example like this in the example YARPP template file `yarpp-template-
   list.php`: [https://svn.wp-plugins.org/yet-another-related-posts-plugin/trunk/yarpp-templates/yarpp-template-list.php](https://svn.wp-plugins.org/yet-another-related-posts-plugin/trunk/yarpp-templates/yarpp-template-list.php)
 * I hope that helps. 🙂
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192178)
 * [@ahaenor](https://wordpress.org/support/users/ahaenor/) – ps: I’m curious about
   what you’d like to use such an array for.
 *  Thread Starter [Ahaenor](https://wordpress.org/support/users/ahaenor/)
 * (@ahaenor)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192219)
 * > you can do this by looping through the related posts in a YARPP template and
   > then putting each posts’ data into an array. I have an example like this in
   > the example YARPP template file yarpp-template-list.php: [https://svn.wp-plugins.org/yet-another-related-posts-plugin/trunk/yarpp-templates/yarpp-template-list.php](https://svn.wp-plugins.org/yet-another-related-posts-plugin/trunk/yarpp-templates/yarpp-template-list.php)
 * Yes, thanks one more time, i’ve already came to this way and it’s goes well. 
   Exactly, i’m creating the posts’ array in the template file, then json-encoding
   and echoing it.
 * > I’m curious about what you’d like to use such an array for.
 * Well, in case of mine the need of all this stuff has been born from the object
   to get the latest news from RSS feeds and then automatically assign to them some“
   related” posts. But object is making agile and editable the link between topic
   and posts, related to it.
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192220)
 * Alright, best of luck!
 *  [drcherrychocolate](https://wordpress.org/support/users/drcherrychocolate/)
 * (@drcherrychocolate)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192358)
 * I’m also going to try this. For each post, there is a thumbnail gallery of images
   attached to the post. My goal is to get a list of the images attached to the 
   related posts, and add them to that gallery.
 *  [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * (@mitchoyoshitaka)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192359)
 * It’d be great to see what you put together.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘[Plugin: Yet Another Related Posts Plugin] Get related posts as array’
is closed to new replies.

 * 6 replies
 * 3 participants
 * Last reply from: [mitcho (Michael Yoshitaka Erlewine)](https://wordpress.org/support/users/mitchoyoshitaka/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/plugin-yet-another-related-posts-plugin-get-related-posts-as-array/#post-1192359)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
