Will buying wings of liberty or heart of the swarm allow me to play ranked ladder with the legacy of the void expansion, both WoL and HotS is 50% off and starter edition of SC2 allows me to play LotV expansion
No, you can only play ladder for the edition of of StarCraft 2 that you have. The exception is if you team up one a friend you can use the "temp upgrade to your friends' edition" that they offer but that is just while you are playing with your friend.
If you want to play LoTV ladder, you need to buy the LoTV standalone "expansion".
For what it's worth (my opinion, this point on) it's worth the money if you are going to play both the campaign and do ladder.