Hi,
I have also faced the same issue with hostgator. I did two changes and my sub-domain started working
1) Added a sub-domain: *.domain-name.com and document root will be where all the wordpress files are located
2) Then went to “Advance DNS Zone Editor” and added A record.
Name: *
TTL: 14400
Type: A
Address: will be the same as of the main domain A record.
Hope this helps.