Just paste the following snippet to your theme’s functions.php file but remember when you add the snippet, you do edit lines 4 and 5 as per your requirements.

Snippet Source/Credit: TutsPlus