In wordpress, there is no in-built functionality for assigning gender to users. Also there is no such functionality on the comment form. So we need to add custom code to achieve this functionality as per the steps