Extending arrays in parent theme without completely overriding the files

I don’t know exactly how your themes– parent and child– are constructed but the child theme’s functions.php loads before the parent’s. So, if this template is included via functions.php changes you attempt to make in the child functions.php to that $Icons array will be overwritten as soon as the parent function.php loads. Since you say … Read more

Adding code to the function file

If you move the function and the add_filter function to the functions file, the you don’t need to echo the function after. If the function doesn’t involve using add_filter then you could echo out the function in your template file. Placing it in the functions.php file, will run on every page/post load unless specified otherwise.