Quantcast
Channel: Tagged with repeater - Plugin Support
Viewing all articles
Browse latest Browse all 160

Query Relationship in Subfield Repeater

$
0
0
Hi,

I'm currently working on building a website for a drama group, in which I've created pages for the actors and pages for the plays. In the plays there is a field [actors_role] with two subfield2 [role] and [actor] where they can name the role and attach the actor to this role using the Relationship option.

Now I'm trying to display the name of the play on the page of the actor. So far I've come up with the following:

<?php the_field('name'); ?> has played in:



<?php <br />
$plays= get_posts(array(
'post_type' => 'plays',
'meta_query' => array(
array(
'key' => 'actors_role_%_actor',
'value' => '"' . get_the_ID() . '"',
'compare' => 'LIKE'
)
)
));

?>
<?php if( $plays ): ?>

<?php endif; ?>


But it does not seem to work at all for what I try. Is it even possible to array in the subfield of a repeater?

I'm still a beginner in PHP, but I've searched a lot and I couldn't figure this one out on my own. So any help is welcome :)

Tnx!

Viewing all articles
Browse latest Browse all 160

Trending Articles