Home Forums Add-ons Repeater Field Relationship inside Repeater field


Relationship inside Repeater field

  • Hi,
    I’m having some issues displaying data and as I’m not a developer, I’d appreciate your help.

    I have a repeater named “awards” with 3 relationship fields inside: “award_name”, “award_category” and “award_level”. They are related to custom post types and work fine on the admin UI.
    But when I try to get the data at the single.php I fail miserably.
    I’ve tried a lot and that’s my code right now:

    	while( have_rows('awards') ) : the_row();
    		// create variables for sub field values
    		$sub_field = get_sub_field('award_name');
    	<li><?php echo $sub_field; ?></li>
    	<?php endwhile; ?>

    It is not returning anything.
    When I var_dump, I get this: string(0) “”

    Can you help me, please?
    Thank you

  • There isn’t enough information here because you say that if you use var_dump() that you get not value. That tells me that there is no value in the relationship field. So either there is no value or there is more information that I would need to have.

    Is the awards field a sub field of some other field? (group, repeater, flex)

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.