First of all don’t ever edit core files. Your changes will be lost on update. WordPress has a great way to expand as needed called Plugin.
As you don’t have enough knowledge about how WordPress works I suggest to use this ready made solution to avoid any risk. Here is the link