I have already tested on the same day of the answer and it is working completely fine with the theme. Can you please tell me where you are adding this function in theme file? or tell me the location where you want than may be I can help you. If you want it into the header than you must have to place this function between theme header tags. I will give you entire code for header tonight now I am outside.