Exclude category children get_categories

I’m not sure why this isn’t working. I want to exclude categories 406, 982, and 1319 and their children from the list. I don’t see any other arguments on wp codex. Does ‘exclude’ automatically exclude children? Is there another way to do this?

**Edit: I can’t even limit the results to 10.

<?php
$args = array(
    'exclude' => '406,982,1319',
    '#'       => '10'
);
$sidebar_artists = get_categories($args);

echo "<ul>";
foreach ($sidebar_artists as $sidebar_artist) {

    echo '<li class="cat-item">' . $sidebar_artist->category_nicename . '</li>';
}
echo "</ul>";
?>

Related posts

Leave a Reply

2 comments