WordPress Filter & Sort Categories
2 min readSep 2, 2020
Include & Exclude Categories
Pass an argument to get_categories()
or wp_list_categories()
.
The argument is an array that has one item called include on the left and the actual category IDs separated by a comma on the right side.
$args = array('include' => '229,198');foreach (get_categories($args) as $cat) {…