I’ve created an archive page that’s working successfully. On each item I have the below code showing the “issue” name for each post:
<?php
$issueblock = get_field_object('big_issue');
$issueselect = get_field('big_issue');
if( $issueselect ) {
echo $issueblock['choices'][$issueselect];
}
?>
This works when first entering the page, but when I have it filtered (filtered by issue, so same page just “?issue=4” at the end, using techniques from https://www.advancedcustomfields.com/resources/creating-wp-archive-custom-field-filter/), the get_field_object is blank. No array. Get_field is fine (I’ve echoed it within that if statement successfully). The Post ID is there (I tried adding that in get_field_object with no luck). Just, for some reason, no array. Any ideas?
Did you ever get this fixed? I’m having the same issue.
Unfortunately no. I had to completely restructure everything I was doing.
Damn. Thanks. If I come up with anything, I’ll let you know.
It may be too late for you, but I noticed that it was working on a different installation of WordPress. On my local machine, it is failing, and I have Early Access enabled (https://www.advancedcustomfields.com/resources/upgrade-guide-version-5/). It is working fine on a different installation where Early Access is not enabled.
I also faced same issue, and tries using acf_get_field()
function.