The meta_value has the key there, which is the same key I see in wp-admin – ACF. So, no missing key in the database.
Yes, I am only using ACF from wp-admin, not using any other tool. And ACF is the latest version. Is that a bug?
Thanks for answering. But I don’t think the code has problem. When I changed field_name “is_premium_customer” to field_key, then I got the value, even the guide here shows usage og field_name.
I found the reason. The ACF group I created with the default post category (Uncategorized). Then the group is applied to all other default adding / editing action for posts, pages or CPTs.
No, I don’t have any answer for this, unfortunately.
Now, I see the same error as you posted above. However, I am not sure why it runs the “else” there?
No, there is nothing shown there. The worst thing is no error returns in front-end. Just a blank space. It cuts off all results, WordPress code after that. For example, no more footer, even when I view source code, there are still close body, html tags. Something likes break in the loop.
In the server log, there is error recorded anyway:
Stack trace:
#0 /home/<username>/domains/<the-domain-name>/public_html/wp-includes/class-wp-hook.php(287): newfunction_loop('')
#1 /home/<username>/domains/<the-domain-name>/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
#2 /home/<username>/domains/<the-domain-name>/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 /home/<username>/domains/<the-domain-name>/public_html/wp-content/themes/genesis/lib/framework.php(66): do_action('genesis_loop')
#4 /home/<username>/domains/<the-domain-name>/public_html/wp-content/themes/theme20/page-abc-template.php(73): genesis()
#5 /home/<username>/domains/<the-domain-name>/public_html/wp-includes/template-loader.php(106): include('/home/<username>/dom...')
#6 /home/<username>/domains/<the-domain-name>/public_html/wp-blog-header.php(19): require_once('/home/<username>/dom...')
#7 /home/<username>/domains/<the-domain-name>/public_html/index.php(17): require('/home/<username>/dom...')
# in /home/<username>/domains/<the-domain-name>/public_html/wp-content/themes/theme20/page-abc-template.php on line 64
OK, I need to combine:
– that https://www.advancedcustomfields.com/resources/dynamically-populate-a-select-fields-choices/ to get the current value of current Metabox.
– and this https://www.advancedcustomfields.com/resources/acf-fields-post_object-query/ for listing all other pages following the $args, in case there is no meta value in the current post.
Now the issue is solved.
Just not sure if there is a better way to achieve?
Thanks for answering. I actually read that example, but still have no clue how to get data from query_args, like I am using with Metabox right now. Can you help to give me more details how to implement it, please?
Thanks.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.