• Resolved marcop1982

    (@marcop1982)


    Hello,
    I am planning to use Pods with my publishing house website.
    I would like to know what would be the best practice to link authors and books.
    I will need to display related authors in book product page and related books in the author page.

    • should I create to custom post type with pods (authors and extend the post product) and create “related books” field in the first one and “related authors” in the latter, and then, for both “bi-directional relationship”?
    • Or would it be much simpler just add “related authors” pods in product page and when I need to display the related books in author page, doing a reverse query (if this is possile)?
    • Or doing something completely different?

    I hope I was able to describe the problem as clear as possible..
    Thanks in advance!

    Marco

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jory Hogeveen

    (@keraweb)

    Hello @marcop1982
    Both situations you describe would work perfectly fine.
    If you are planning you use custom templates there is no major difference but if you want to use Pods templates I’d advice you to use a bi-directional relationship.
    Good luck!
    Cheers, Jory

    Thread Starter marcop1982

    (@marcop1982)

    Thank you Jory!
    Just one more thing: is there a link in the documentation about reverse query?

    Thank you very much, and happy Christmas!

    Marco

    Plugin Author Jory Hogeveen

    (@keraweb)

    This can all be done with get_posts() or WP_Query by using the meta query. Relationships are stored by their ID’s so you could query all posts that have a relationship (by key) to the current post.

    Happy holidays do you too!

    Cheers, Jory

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Best practice’ is closed to new replies.