Support » Plugin: Custom Related Posts » Get related posts as array

  • Resolved cjmling

    (@cjmling)


    I want to be able to list of related posts as an php array or object, so i can further process the data and do some custom display as per my need.

    Are there any inbuilt function?

    If not are related posts saved as some meta or post or something. so i can do some custom query to get that? any info will be helpful.

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author Brecht

    (@brechtvds)

    Hi there,

    You should be able to get the array of relations from or to a specific post like this:

    $relations_to = CustomRelatedPosts::get()->relations_to( $post_id );
    $relations_from = CustomRelatedPosts::get()->relations_from( $post_id );
Viewing 1 replies (of 1 total)
  • The topic ‘Get related posts as array’ is closed to new replies.