My recommendation would be to use a plug-in like Lightbox Plus to power your link. Clicking the link would load your standard login form inside a lightbox. You could then automatically redirect to the same page so that, once logged in, users can leave a comment.
Basically, you’d dynamically build your link to be something link this:
<a href="http://yoursite.com/wp-login.php?redirect_to=http%3A%2F%2Fyoursite.com%2Fpostname" rel="lightbox[login-form]" itle="Please login to comment">Login to Comment</a>
This would load the login form in a lightbox and set it to redirect to the post upon successful authentication. This might be all you need, but I haven’t tested it … so give it a try and, if needed, add some other scripts to reload the page upon successful login.
Related Posts:
- how to use reCaptcha v3 in wordpress custom login form?
- Adding “Remember Me” in custom login
- wp_set_auth_cookie() doesn’t work in Ajax call
- How build a custom login/register form with error handling?
- Update user meta using with ajax
- Detecting post type within init action
- How to link WordPress heartbeat to ajax form
- WordPress Ajax Login without page reload
- WordPress Nonce Issue for Ajax Login and Logout
- How can I automatically login using a URL?
- How to correctly load wordpress in a non WP script for AJAX request
- Custom Login and Registration form in Ajax
- Insert wp_editor on front-end with AJAX?
- Help with AJAX front end comment moderation
- Is it safe to manually sign a user in using AJAX?
- Using AJAX with Forms
- Three level taxonomy dropdown frontend
- Why a strange discrepency between get_current_user_id() when using AJAX versus output of document.cookie?
- Performance optimization of tree like structure
- Ajax login without redirect/reload
- Is it secure to use admin-ajax.php in front?
- Best way to use ajax front-end?
- Interim-Login form on frontend
- Custom Login with Ajax not working with IE
- wp_ajax declaration confusing for Front end
- How to get post from pure frontend AJAX (using only post ID)?
- jQuery.post returns 0
- Ajax login fails: script sets cookies, but is_user_logged_in() returns false
- How to prevent my external API call from being called by anyone but me (my site)
- WordPress custom ajax login not working on mobile browsers
- Update user meta via ajax from frontend, saving issue
- Edit user meta on front-end via AJAX
- How to test if in dashboard, bypassing Ajax quirk
- ajax page template
- I’m trying to register with AJAX
- Nonce verification problem when logging in after a logout
- PHP “php://input” vs $_POST
- Google Maps API throws “Uncaught ReferenceError: google is not defined” only when using AJAX
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
- How to solve the error “SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.” in IE
- Show spinner GIF during an $http request in AngularJS?
- Refresh HTML Page in Browser Automatically on Timer – Every 15 Min
- JavaScript implementation of Gzip
- jQuery: Performing synchronous AJAX requests
- ASP.NET MVC controller actions that return JSON or partial html
- jQuery’s .on() method combined with the submit event
- Ajax takes 10x as long as it should/could
- How to check if I am in admin-ajax.php?
- How can I redirect user after entering wrong password?
- Best way to end WordPress ajax request and why?
- How to load wp_editor() through AJAX/jQuery
- How to cache json with wp-super cache
- Load minimum WordPress environment
- Why use wp_send_json() over echo json_encode()?
- Why use admin-ajax.php and how does it work?
- How to get a unique nonce for each Ajax request?
- Open a Thickbox with content trough AJAX
- Initialize TinyMCE editor / visual editor after AJAX insert
- Why not register shortcodes if is_admin dashboard?
- How to show ‘login error’ and ‘lost password’ on my template page?
- WordPress AJAX with Axios
- Upload post thumbnail from the front end
- Why is die() used at the end of function that handles an Ajax request?
- Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
- Making my AJAX powered WordPress Crawlable
- Custom login form
- Is there a JavaScript API? How to access public and private data in JS?
- Get Previous & Next posts by Post ID
- is_admin() returns true when using admin-ajax.php from front end script
- failed to load wp-admin/admin-ajax.php
- Using Backbone with the WordPress AJAX API
- Using Ajax with a Class file
- Ajax in a settings page (update_option is undefined)
- Prevent wp_login_form() from redirecting to wp-admin when there are errors
- How to pass data parameter to ajax action function handler
- WordPress Ajax Data Security
- Redirect user using the ‘wp_login_failed’ action hook if the error is ’empty_username’ or ’empty_password’
- Displaying PHP Errors from admin-ajax.php
- gettext does not translate when called in ajax
- WordPress AJAX File Upload – FrontEnd
- Execute one AJAX request after another AJAX request finished
- WP-AJAX vs WP REST API: What to use for requests to the website from outside?
- Ajax and autocomplete
- How do I change the language of only the login page?
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Disable WordPress 3.6 idle logout / login modal window / session expiration
- How to add to cart via AJAX Woocommerce [closed]
- Nonces and Cache
- SSL breaks customizer: page isn’t returned from ajax
- Why is a 500 error generated by admin-ajax.php not going into the Apache error log?
- Are ‘wp_ajax’ and ‘wp_ajax_nopriv’ exclusive to authenticated and non-authenticated users?
- How to HTML5 FormData Ajax
- admin-ajax.php vs Custom Page Template for Ajax Requests
- How to override WP_DEBUG for Ajax responses?
- Stop admin-ajax?
- redirect out of wp-admin, without losing admin-ajax.php
- Call to undefined function add_action()
- Avoid to load default WP styles in login screen
- How to fake a WordPress login?