Support

Account

Home Forums Front-end Issues Display all options in a checkbox array

Solving

Display all options in a checkbox array

  • Howd y’all,

    Sorry if this is explicitly stated in the documentation, but I’ve had some trouble finding something specific to my needs.

    Currently I’ve got a working array of custom posts, and am using the ACF plugin to add some checkboxes to those posts. Simply put, I’d like to have the options in the checkbox array I’ve created listed in it’s own div.

    In other words, in ACF I’ve created a checkbox with a field name of ‘bulb_type’ and the options ‘halogen’,’cfl’,’led’, and ‘other’. I’d like to show all the checkbox options (not tied to a post or specific post) on the front-end like so:

    Bulb Type:
    Halogen
    CFL
    LED
    Other

    But just a list of those options, not necessarily within a post or tied to any post, just on it’s own. Can this be done?

  • Do you have a reason not to use a taxonomy for this?

    https://codex.wordpress.org/Taxonomies

  • My apologies, maybe I wasn’t too clear. It isn’t really a category for the post, it’s more of a meta_key array. So I’ve created the custom meta box with acf, with some checkbox options and would want to list all the options (not attached to a specific post) on the front end.

    Hope that’s a better illustration of what I’m trying to achieve here.

  • You are correct that it’s not very clear what you are trying to do and we’ll probably need more detail.

    What is the location of the field group? Do you want to show the values that have been saved or the “choices” that you have set up for the field?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.