Support

Account

Home Forums ACF PRO Display CF from different CPT into the loop Reply To: Display CF from different CPT into the loop

  • Hi @kevin-mamaqi

    You’re almost there. Change your foreach loop to this so it sets up the post object properly and allows you to use the_field and wordpress functions.

    
    <?php foreach( $videos as $post ): setup_postdata($post); ?>
    	<article class="post blog-post">
    		<div class="video-container"><?php the_field('url_del_video'); ?></div>
    		<h3 class="titulo-video"><?php the_title(); ?></h3>
    	</article>
    <?php endforeach; wp_reset_postdata(); ?>