How can i get rid of warning messages [closed]

It looks like your $categories is an empty array. To solve this always check if the array is empty or not.

In line 117 add code to check if array is empty

<?php if( !empty( $categories ) ){ ?>

and in line number 167 replace

<?php } ?>

with

<?php } } ?>

If you want to permanently remove any error or warning message you can use the php code error_reporting(0);. Pase this in top of your functions.php file.

Additionally open wp-config.php file and check for WP_DEBUG. It must be false;

define( 'WP_DEBUG', false );