For those who want my final code
http://somesite.com/page/?agent=1
$post_id = false;
if ( isset( $_GET[ 'agent' ] ) ) {
$post_id = intval( $_GET[ 'agent' ] );
$value = get_field( "phone", $post_id );
if ( $value ) {
echo $value;
} else {
echo 'empty';
}
}
}
ok. i think i am following, so in the template, would i use this to grab the phone for each agent?
<p><?php the_field('field_name', $post_id); ?></p>
So. this problem has been giving me problems for a year. I had a custom post type with custom page template. I was calling – date() in my template. I realized that i had to change every instance of date() to wp_date(). For instance i had a if(date('D') == 'Sun')
i changed to if(wp_date('D') == 'Sun')