Support

Account

Home Forums General Issues Help configuring Relational Fields

Solving

Help configuring Relational Fields

  • hi there!

    I’m building a bookstore directory.

    I have 3 types of custom posts: Bookstore, Book, and Author.

    – Book can only have one Author, but can be on multiple Bookstores.
    – Bookstore can have multiple books
    – Author can have multiple Books

    I want to be able to:
    If I search for a Book > See a list of Bookstores where the book is available
    If I enter a Bookstore page > See a list of all available books
    If I search for an Author > See his books

    I’m new to ACF and I need some advice on how to set the Relationship Field of this 3 CPT.

    I’m using ACF free version but can go to PRO if that can help me achieve my goals.

    Thanks for your help!

  • Hi @lucasluciano !

    I’m not sure it is an ACF matter. What I would do in your case is:

    • Create a Custom Post Type Book
    • Create a taxonomy Bookstore
    • Create a taxonomy Author

    It’s the WordPress way to do this. No need to use Relationship Field.

    Hope it helps.

  • There is a tutorial on how to do this here https://www.advancedcustomfields.com/resources/querying-relationship-fields/

    There is also a plugin that created bidirectional relationships https://wordpress.org/plugins/post-2-post-for-acf/

  • @kyfr4n thanks for your help! Unfortunately, I need to have some content on each Author and on each Bookstore (pics, text, etc), if I set them as just taxonomies I’ll not be able to add much more than a short description, that’s why I need those to be a Post.


    @hube2
    Great! Thanks for the bidirectional tutorial, I think I can work from that!

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Help configuring Relational Fields’ is closed to new replies.