Support

Account

Home Forums Front-end Issues Extracting Post Object data from within a Repeater Reply To: Extracting Post Object data from within a Repeater

  • Hey Jonathan –

    I gave that a shot but it isn’t working, and I think it’s because I am trying to access this data from within a foreach loop, like so:

    <div class="news-container">
    
    <?php $news = get_field('ssm_featured_content'); ?>
    
    <?php foreach ($news as $item) { ?>
    
    	<?php $postObject = get_sub_field('ssm_featured_page'); ?>
    	
    	<?php echo $postObject->$post_title; ?>
    	
    	
    <?php } ?>
    
    </div>
    <!-- end .news-container -->

    I tried to adjust as follows, but I am not sure how the code should look:

    <?php echo $item[$postObject->$post_title]; ?>

    but that didn’t seem to be correct either. I’m just not sure how to handle this.

    Rich