Forums

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

  1. Ahaenor
    Member
    Posted 3 months 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. mitchoyoshitaka
    Member
    Posted 3 months ago #

    @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. mitchoyoshitaka
    Member
    Posted 3 months ago #

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

  4. Ahaenor
    Member
    Posted 2 months 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. mitchoyoshitaka
    Member
    Posted 2 months ago #

    Alright, best of luck!

Reply

You must log in to post.

About this Topic