Home Forums Front-end Issues Can't retrieve the_field() values


Can't retrieve the_field() values

  • Hi all,

    I have a feeling it’s trivial but it’s been a while i’m stuck on that one.

    I created a flexible content “quote” custom field for all post_type == post, appears well in wp-admin and i’m able to fill it in just fine.

    Then on single.php I have the following block:

    <?php if ( get_field('post_quote_field') ): ?>
    <div class="post-quote">
    		<h3 style="text-align: justify;"><?php the_field('post_quote'); ?> - <a href="<?php the_field('post_quote_source_link'); ?>" target="_blank"><?php the_field('post_quote_author'); ?></a></h3>
    <?php endif; ?>

    Nothing is being displayed. I tried to call the_field(‘post_quote’, 8067); ?> even if it is in the loop, but nothing displays either. I have tried calling the_sub_field() but same result. I’m sure it’s not a typo in field names and can’t think of anything else to try.

    Please let me know if you need more info to help…

    Very best,

  • To precise, I do have ” – ” displayed which means it’s not about the if statement. Also, the structure of the flexible content custom field is as follows:

    field name: post_quote_field
    layout name: post_quote_block
    field_name: post_quote
    field_name: post_quote_author
    field_name: post_quote_source_link

  • My bad, I knew it was trivial – found answers in – didn’t make the link between nested repeaters and flexible content.

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

The topic ‘Can't retrieve the_field() values’ is closed to new replies.