I have radio checkbox fields containing city names. I need to extract all values from this field, then display on the page only values that are contained in atleast one post of given category.
I know I can get these values with <?php echo implode(', ', get_field_object('example')[choices]); ?>
and this is working fine on single article, but not in page.
I know that I should use get_option('page_for_posts') in pages, but this never worked for me. I didn’t even set page for posts.
Any idea to extract this field on a page?
Thank you for your reply. I’m sorry for my bad explanation and your lost time.
I have a radio button fields with city names. I’m trying to retrieve all of these values regardless of the selected one. I am able to do it with the code <?php echo implode(', ', get_field_object('example')[choices]); ?> when I insert it in the single.php page of my template. The above code doesn’t work in page.php.
When I will be able to extract all these values in an array, then I will process them one by one to check if posts with the related city name exist and if true echo a link on the page.
Thanks in advance