Adding that code will not do anything as it is not a valid option for the config.xml. There is a plugin that will help you to achieve this though.
surajpindoria which option is not valid? <preference name="Orientation" value="portrait" /> is a valid option (Config.xml - Apache Cordova ), the difference is the O is capital letter, but I think preferences ignore capitalisation.
But yeah, probably using the plugin you mention is a better option
Sorry, I should have clarified. I was referring to the code under "<!-- Second block of code to be put anywhere in global scope -->".