Home › Forums › General Issues › If a checkbox value is checked › Reply To: If a checkbox value is checked
I have radio buttons set up with three options:
Out of Stock
These are set up to run on a custom post type, ‘Book’
I want to output something different depending on which option is checked.
This all takes place within the loop.
I don’t have any code relevant to the issue to show I’m afraid. I had previously used a single checkbox and called it as follows:
<?php if ( get_post_meta($post->ID, 'paperback', true) ) : ?> Paperback <?php endif; ?>
This worked fine, but I don’t know how to query the custom field AND the option selected, which is the problem here.
I hope that’s a bit more clear, sorry I can’t provide more!
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!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.