Dear experts
Im not very good at PHP, but still have managed to setup a small wordpress showing books and their authors.
So I have two custom post types: Books and authors.
On the Book pages, I would like to query all books that have the author(s) of the current book have written. Most of the times, a book will only have one author. I have on each book-page a relationship field called “authors”. I just cant wrap my head around how to query all books that have same author as the current book.
I would like it to show up like this:
Books by [Author1]
– Book Title 1
– Book Title 2
Books by [Author2]
– Book Title 1
– Book Title 2
And is it possible to hide the current book in the query?
It is difficult for me to google this as I dont really know what my problem is called 🙂 Any help would be highly appreciated.
Hi John,
Thanks for your answer. It is not too late, so I will try to create a bidirectional field and see if I can make it work. Thanks again 🙂
Hi John,
I cant thank you enough for your time it reply my question and for writing this plugin. (I can see that you are the plugin author).
It works just as it should. Thank you again