$(function(){
// this will get the full URL at the address bar
var url = window.location.href;
// passes on every "a" tag
$(".main-nav li a").each(function() {
// checks if its the same on the address bar
if(url == (this.href)) {
$(this).closest("li").addClass("current");
}
});
});

After wordpress login redirect page but not refresh so please try to add these lines in the top of the your wordpress theme file like header.php or wp-config.php
https://www.youtube.com/watch?v=ItTjUrTZ_JE