It depends on his age, which is not made clear.
Younger guys are greatly influenced by peer pressure. They can and will behave differently towards women if they are with their friends than they do in private. Check if he is ignoring you when his friends are around and being nice to you when they are not.
If this is the case, he does really like you, but does not think that his group will 'approve' of the relationship. You are seen as not being 'hot' or 'cool' enough.
Try talking to him about it. Either he is mature enough to agree, and change his behavious, or he is immature enough to deny or continue the behavious. If the last, give up and find someone emotionally older.
If this is about an older guy, say over 20, you have a bigger problem, and would need to post more details here for answers. Look especially at the circumstances, as above - what triggers the ignoring behaviour. There is always a cause - you just have to pin it down.