How can i show specific Category List?
Question
By this code ,it shows all the category.but i want to show specific some category(like-Officer,Training) Thanks in Advance
<?php
// change category to your custom page slug
$categories = get_categories();
foreach ($categories as $category) {
$option .= '<option value="'.get_option('home').'/category/'.$category->slug.'">';
$option .= $category->cat_name;
$option .= ' ('.$category->category_count.')';
$option .= '</option>';
}
echo $option;
?>
</select>
0
categories, javascript, php
4 years
2019-11-28T03:58:19-05:00
2019-11-28T03:58:19-05:00 0 Answers
74 views
0
Leave an answer