I’m working with ACF Pro 5.6.1 on the website of a little open air theatre – http://www.reckenfeld-freilichtbuehne.de
There are 2 custom post-types, filed with ACF-fields.
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: https://th-url.de/OiBRd
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: https://th-url.de/OiBRd
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.
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”: https://th-url.de/JWSbC
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.
You must be logged in to reply to this topic.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We've just released ACF 5.12.3 with a security fix to prevent arbitrary file uploads to forms with ACF fields.— Advanced Custom Fields (@wp_acf) July 14, 2022
Now that we've released this update, we recommend updating your sites as soon as possible.
© 2022 Advanced Custom Fields.