Get customize categories in wordpress

The following example will show the categories with checkbox

<?php
$args=array(
‘child_of’ => ‘1’,
‘hide_empty’ => ‘0’
);
$categories = get_categories($args);
foreach($categories as $key => $value){
?>
<label><input name=”escorts_category[]” value=”<?php echo $categories[$key]->cat_ID; ?>” type=”checkbox”> <?php echo $categories[$key]->name; ?></label><br />
<?php } ?>

For more information click here

Share This Post

Post Comment