First of all, a function is basically a "shortcut" in coding. For example, If you wanted to display your sidebar in severa pages but did not want to copy the code over an over you could make a function to display it. Than you would just need one line of simple code and your sidebar is there!!