How do I count how many top level categories there are?
As the Codex says, this is the code block to query for only the Top Label categories — the parents. With this, I used the PHP function count(). <?php $args = array( ‘parent’ => 0, ‘hide_empty’ => 0 ); $categories = get_categories( $args ); echo count( $categories ); ?>