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 set hide_empty to false in your get_categories() function’s arguments, as per the below example.

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