I’ve seemed everywhere in the ACF boards, learn the documentation and in addition checked out comparable questions right here with out success. So, i am posting with the hopes of determining what I am doing unsuitable.
I’ve a True/False ACF subject, mba_exclude, hooked up to my classes. My purpose is to easily have a class not present on the entrance finish when the person turns the sector to ‘Sure’, which ought to exclude that class from exhibiting. I plan to have the vast majority of the classes proven be by default, which is why I’ve a real assertion there in case the person needs to show it off.
Here is how I am querying the classes:
$args = array( 'taxonomy' => 'class', 'hide_empty' => 0, 'meta_query' => [ 'key' => 'mba_exclude', 'value' => '1', ], ); $c = get_categories($args);
Here is my html for the way I am exhibiting these on the front-end:
foreach ($c as $class): $counter++; ?> <div class="col-12 col-md-Four col-xl-3"> <div class="customize-card-sm checkbox"> <enter class="customize-select" id="category-<?php echo $counter ?>" kind="checkbox" title="classes" worth="<?php echo $category->term_id ?>"> <label for="category-<?php echo $counter ?>"><?php echo $category->title ?></label> </div> </div> <?php endforeach;?>
Once I do a var_dump on $c, I get each class nonetheless, it doesn’t matter what. I’ve tried altering the formatting of the meta_query in my code to match the array() type within the ACF docs (above) with out success. I am nonetheless newer to WP improvement, and would recognize any help right here. Thanks!