get_categories() not working in WordPress

Is your get_categories() function not working by showing any matches? You may need to allow the display of empty categories.

Making get_categories() display all categories

Your get_categories() function will only be displaying results for categories in use as default.

In order to show all the categories, try to pass hide_empty into your get_categories() function as per below.

foreach ( get_categories( array( 'hide_empty' => false ) ) as $category ) {
     //Do your output here
}