I am using advanced custom fields Checkbox feature in wordpress.
I have created a <ul>
with four <li>
<ul class="post-icons">
<li class="microphone" title="Alt text"></li>
<li class="video" title="Alt text"></li>
<li class="text" title="Alt text"></li>
<li class="image" title="Alt text"></li>
</ul>
And i have created four Checkboxes in advanced custom fields. If I use this PHP in the class="(here)"
.
<?php echo implode(' ', get_field('field_name')); ?>
It will print the value of the Checkboxes on to the class"" but it will print all four Checkboxes values that i have created. I only would like to print the right one on the right place.
The best way would to use .active
class but advanced custom fields doesn't allow multiple Checkboxes with the same value. I mean that if you Check a Checkbox on Image and text it would print .active
or something wise on
<li class="image" title="Alt text"></li> and
<li class="text" title="Alt text"></li>
Like = <li class="image active" title="Alt text"></li> and <li class="text active" title="Alt text"></li>
I have four Checkboxes
- Video
- Text
- Sound
- Image
And four <li>
- <li class="video"></li>
- <li class="text"></li>
- <li class="microphone"></li>
- <li class="image"></li>
microphone = Sound
I would like to print .active
on the right <li>
class""
item. When the corresponding Checkbox is checked
I will link to the Documentation for advanced custom fields Checkbox I didn't understand a lot of how to create something what I would need for my project.