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: https://i.imgur.com/aMbIuJH.png.
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!
Regards.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.