Support

Account

Forum Replies Created

  • Thanks for the reply mtv.jcil, but I’m still not getting this to work. I know it’s probably super simple but I can’t seem to make it work.

    I have a field on a custom post type that associates that post with a user. In my template file, I’m just trying to echo the ID of that user. Here’s a simplified version of what I’m using, just to test if it works.

    <?php
    	$person = get_field('person_author');
    	$person_id = $person['ID'];	
    ?>
    
    <p>ID: <?php echo $person_id[0]; ?></p>

    It’s not echoing anything though. Mine’s not in a repeater so I changed it to get_field.

  • Thanks for the response! I’ll try out your code in a bit. I’m just doing a very basic post query and I’m trying to echo the user ID from a user field to add to the $args to only show posts by the author specified.

  • I’m looking to do the same thing and I can’t get it to work for the life of me. I’m trying to echo the ID from a user field and all I get is the whole array. I tried Jeremy’s code and it didn’t work for me. Anyone else have this issue?

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