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:
Forthcoming
In Stock
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!
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.