Closed naires closed 12 years ago
i just solved it. it's quiet simple, that's why i'm a zero in coding :)
First use the array_keys to select only the keys with value 1: <?php $categories = of_get_option('check_categories' ); ?> <?ph array_keys($categories, 1); ?>
After put the function inside implode function to get the keys separated with commas like this:
<?php echo implode(', ',array_keys($categories, 1)); ?>
And the final result is:
13,7,6,1,18 this are the Category ID's that are multicheck in my options
hai naires, can you help me, I want to show all category that selected using multicheck. and every category that show, have thumbnail image that was get from first post on that category. example I have 3 category, "kawasaki", "honda" and "yamaha". I select category at multicheck "honda" and "yamaha". So category that will show is "honda" and "yamaha" with thumbnail image from first post that have category "honda" and "yamaha". thanks
Hi,
i have this:
After i made multiple checks in categories this is the array saved into wp-options:
Array ( [13] => 1 [7] => 1 [6] => 1 [23] => 0 [12] => 0 [5] => 0 [11] => 0 [22] => 0 [3] => 0 [14] => 0 [1] => 1 [17] => 0 [10] => 0 [18] => 1 )
and my question is:
13, 7, 6, 23, 12 etc are my blog category ids and what i need to know is how can i extract only the $category->cat_ID numbers/values checked = 1?
i have tried <?php echo implode(', ',of_get_option('check_categories' )); ?> but the result is 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1 and i want 13,7,6,23 and 1, all the [values ]=1
Thanks, nelson