Support

Account

Home Forums Front-end Issues CPT and ACF Reply To: CPT and ACF

  • Hi @crlannen

    I believe you can use this code:

    <?php
    $posts = get_field('project_client');
    $projectUrl = get_field('project_url');
    
    if( $posts ): ?>
        <?php foreach( $posts as $post): ?>
            <?php setup_postdata($post); ?>
            <div class="client-name"><a href="<?php echo $projectUrl; ?>"><?php the_field('client_name'); ?></a>
        <?php endforeach; ?>
        <?php wp_reset_postdata(); ?>
    <?php endif; ?>

    If it isn’t working, could you please share the JSON export file of your field group?

    Thanks!