Home Forums ACF PRO Querry with repeater-sub-fields


Querry with repeater-sub-fields

  • Hi there,

    I’m working with ACF Pro 5.6.1 on the website of a little open air theatre –

    There are 2 custom post-types, filed with ACF-fields.

    1. actor-overview
    2. play-overview

    1. actor-overview
    Every actor has it’s own profile page with a list of plays he/she takes part – with the year, name of the play and the name of the theatric part. For example – the profile page of Miriam:

    ACF-Field-group: actors
    repeater-field: saison

    repeater-subfields of saison:
    1. year -> when you can see the play on stage (choice box)
    2. play-name -> name of the play (choice box)
    3. actor name -> first and last Name of the actor (choice box)
    4. theatric part -> the name of the part in the play (1-row-text-field)

    Example on Miriams profile page:

    Here you can see (example):
    (2017) “Michel in the soup bowl”: participant of the…

    2017 = field “year”
    “Michel in the soup bowl” = field name of the play
    participant = field theatric part

    The field “3. actor name” is hidden on the profile pages, but it’s available.

    2. play-overview

    Every play has it’s own detail-page with description, images, play-dates, prices etc. – and a list of the actors. Example of the play 2017: “Michel in the soup bowl”:

    The play-plages has an own group of ACF-fields like description, prices, image-galleries, dates etc.

    My plans are now like this:

    create a dynamic list of actors of the play – with the theatric part

    There are some information, which are identical in the background:

    Every actor post and every play-post are in the same category. The name of the categories equals the name of the play.

    Example in angled brackets:
    play-name: [Michel in the soup bowl]
    category-name: [Michel in the soup bowl]
    repeater sub-field “play-name” @ actor-profiles: [Michel in the soup bowl]

    My idea is now … and I’ve got a problem with the php-querry (should be insered in the play-template):

    1. Get the title/name of the play => Michel in the soup bowl
    2. compare the play-title from 1. with the repeater-sub-field “play-name”

    play-title: [Michel in the soup bowl] = repeater-sub-field “play-name” [Michel in the soup bowl]

    alternative: compare the play-post-category with the repeater-sub-field “play-name”
    3. show me the ACF-repeater-sub-fields: “theatric part”: actor name

    In the end, I need a dynamic list on the play-posts of the actors and their theatric parts. A friend (for 3 weeks on holidays now) told me, it’s verry simple and easy with 3 or 4 querries … but … damm … I’ve got a blockade with this querry.

  • I found a solution with ACF … topic solved

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

The topic ‘Querry with repeater-sub-fields’ is closed to new replies.