WordPress.org

Support

Support » Plugins and Hacks » Redirect comment login to form anchor

Redirect comment login to form anchor

Viewing 4 replies - 1 through 4 (of 4 total)
  • RoselleCelina
    Member

    @rosellecelina

    airaid,

    did you happen to get a solution on this? I’m having the same problem.

    thanks,
    roselle

    airaid
    Member

    @airaid

    It’s been a while but I don’t think I ever found a solution, sorry.

    RoselleCelina
    Member

    @rosellecelina

    BWA-HA-HA-HA!!! I’ve found a solution. AFter many hours of googling and guessing, I figured it out.

    [Disclaimer: I have no idea what I am doing in regards to javascript or php…I’m just making logical guesses. Use this at your own risk.]

    Edit the “connect.js” file, located in your plugins folder under assets, then js.

    locate this

    jQuery('#loginform').append("<input type='hidden' id='redirect_to' name='redirect_to' value='" + window.location.href + "'>");
    		}

    and change to this

    jQuery('#loginform').append("<input type='hidden' id='redirect_to' name='redirect_to' value='" + window.location.href + "#startyourcomment" + "'>");
    		}

    THEN, locate this
    var current_url = window.location.href;
    and change to this
    var current_url = window.location.href = window.location.href + "#startyourcomment";

    Like I said, all I did was google and google for hours. I find that a lot of javascript and php is algebraic, so I just came up with this.

    Hope it helps and hope I was right! 🙂

    RoselleCelina
    Member

    @rosellecelina

    replace #startyourcomment with whatever your anchor link is

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Redirect comment login to form anchor’ is closed to new replies.