WordPress Filter & Sort Categories

Raja Tamil
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) {

--

--

Raja Tamil

👇click the link and get 80% OFF on the premium web development courses (HTML5, CSS3, JavaScript ES6, Vue JS 3 & Firebase 10 https://softauthor.com