Home Forums General Issues get_field returning null after update Reply To: get_field returning null after update

  • Hello @johannesalfanova-dk,

    ACF Extended developer here. I ran some tests on my side with ACF 5.11, and everything looks alright. See test screenshot:

    The code used is get_field('my_field', 'my-post-type_archive').

    Can you please share the code you’re using that doesn’t work on your side? Please note that it is important to use {post-type-name}_archive as Post ID. For example: entries_archive or events_archive.

    Also, can you try to retrieve the field like I did, using plain text code (and not with variables like $posttype), to check if it works?

    You can enable the Developer Mode to get more details about the Archive Page, its ID and the fields metadata like I did on my screenshot.

    Note: ACF Extended doesn’t touch the get_field() function. The Archive Page is just a glorified ACF Options Page, that is automatically placed under the related Post Type menu.

    Hope it helps!