I think one of the hardest things in life is learning how to love others. Especially loving someone who you feel is rejecting you. It could be that the person is rejecting you, or that he/she simply doesn't understand how to love you so you feel rejected. It still makes it hard to have a relationship with that person.
Trying hard to love someone, to reach out, and be regularly rejected is heartbreaking. We've all been there, and in many cases you can just walk away. The person rejecting you is a co-worker, a neighbor, or distant relative, someone that you can be cordial to without having to spend a lot of time and energy on speaking his/her love language. That's not to say that you aren't friendly, but that you won't spend the same time and energy on that person as you do on a family member, an in-law, or a good friend who is going through a difficult time.
When loving someone feels like it is getting you no where, you have to just keep on showing love. The hope is, that eventually he/she will accept your love and show you love too. That the person you're loving will choose to speak your love language and make the relationship a priority. That won't always happen though. Love is a choice, and sometimes people just choose to not love or not to show love. The person may love you, but can't (for different reasons) speak your love language. In some cases, the person refuses to speak your love language. When someone chooses to not speak your love language, it's tempting to give up on that relationship. It's easy to give up, and the world says that it's okay. Walk away, get a divorce, disown the child, get the negativity out of your life, you have better things to do with your time. It's harder, but it's worth it to keep loving him/her. Keep speaking his/her love language. Show that the relationship is important to you. Make that person a priority. Hopefully the other person in this relationship will stop rejecting you.
Occasionally a change happens right away, but more often than not it will take months and sometimes years. For whatever reason, the other person in the relationship is struggling to love you. Maybe it's because of past pain or hurt, maybe the person hasn't felt love from you for a long time and it will take just as much time before he/she feels you can be trusted with love, maybe the person thinks he/she is loving you and doesn't realize you feel rejected and unloved. Whatever the reasons, if this relationship is truly important, don't give up on it. Try loving. Read books about love and how to love, read articles, learn, truly make it a priority. Sometimes people reject others because his/her own love tank is empty. Loving that person can help fill that tank and allow him/her to have more love to give.
Remember that if you wouldn't want that person to give up on you, then don't you give up on him/her.