WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Yet Another Related Posts Plugin] Get related posts as array (7 posts)

  1. Ahaenor
    Member
    Posted 4 years ago #

    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.

  2. @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

    I hope that helps. :)

  3. @Ahaenor - ps: I'm curious about what you'd like to use such an array for.

  4. Ahaenor
    Member
    Posted 4 years ago #

    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

    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.

  5. Alright, best of luck!

  6. DrCherryChocolate
    Member
    Posted 4 years ago #

    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.

  7. It'd be great to see what you put together.

Topic Closed

This topic has been closed to new replies.

About this Topic