I am hooking onto ‘after_setup_theme’ to render the ACF fields when editing a post type. What gets rendered depends on the post type…at this stage there is no global $post and get_post_type() is not available.
So I thought I’d be clever and use $_GET[‘post’] to get the post ID and do a get_post_type to find the post type and render content accordingly.
However, when I do this, the post object field stops working and displays “No results found”. This line of code breaks it all:
Bumping this one as I am completely baffled and it’s really annoying me. Essentially I hook up to after_setup_theme. At this stage I do not know the post ID other than by using $_GET, so this is my code: