How to retrieve connected post on each related post

Support MB Relationships How to retrieve connected post on each related post

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9118
    foundbutlostfoundbutlost
    Participant

    Type: Post to page
    *post1,post2,post3,post4 to page1

    is there any API to call all post connected to page1 on each connected post?

    Example: On post2, how do i call the other 3 post: post1,post3,post4.

    do i have to query the "To" ID in Mb_relationship_table first and then using the id in the Wp query to retrieve all the other post?

    Thank you, i tried my best to explain it to you!

    #9127
    Anh TranAnh Tran
    Keymaster

    Hi,

    I think you're right. First, get the ID of the connected page1. Then do another query to get all posts that connect to page1.

    #9141
    foundbutlostfoundbutlost
    Participant

    You dont think you can make an API for this? i think it will be useful in many cases. thank you

    #9149
    Anh TranAnh Tran
    Keymaster

    I got it. Let me try that.

    #9251
    Truong GiangTruong Giang
    Participant

    Hi @foundbutlost,

    Assume post2 also connects to page2, do you want to retrieve all posts connect to page1 or page 2?

    #9253
    foundbutlostfoundbutlost
    Participant

    Well, in my case that won't happen. Because it's a song -> album relationship so one song can only belong to one album.

    #9390
    Truong GiangTruong Giang
    Participant

    Hi there,

    That feature is added in 1.2.0 version. The documentation is here: https://docs.metabox.io/extensions/mb-relationships/#displaying-sibling-items

    Thank you

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘How to retrieve connected post on each related post’ is closed to new replies.