WordPress.org

Ready to get started?Download WordPress

Forums

WP Modal Login
[resolved] How can I redirect log in link in the comments? (5 posts)

  1. Balleruaille
    Member
    Posted 1 year ago #

    Hi,

    Really like this plugin but I'm having one issue.

    On my website/blog I have checked the box for "Users must be logged in to post comments". However, this means that when a guest user views a post on which comments are enabled, he or she see's a link to log in above the comments which directs them to the default wordpress login page (wp-login). I want this link to activate WP Modal Login instead.

    How may I accomplish this?

    http://wordpress.org/extend/plugins/wp-modal-login/

  2. Cole Geissinger
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Balleruaille, While this will require some programming knowledge, I can provide a gist idea that can get you going in the right direction.

    You can modify the comments template in your theme and use the PHP script to add the modal login. Then you can use add_filter() to filter the URL redirect URL when a user logs in. The name of the function for the filter is 'wpml_redirect_to'. FYI, this filter will be deprecated in the next release, but that's a little way down the road.

    Good luck!

  3. Cole Geissinger
    Member
    Plugin Author

    Posted 1 year ago #

    For an example of how to use the filter visit my comment to a semi-related post - http://wordpress.org/support/topic/how-to-forward-to-certain-page-after-login?replies=3#post-4346361

  4. Micah.Hoffmann
    Member
    Posted 7 months ago #

    Hey I am also in need of help on this.

    I understand the filter and what not, I am just lost on where to add this code. I dont see anywhere in comment.php where I think this should go. Any help would be awesome, thanks.

    Great plugin by the way, I will be sure to donate.

  5. Cole Geissinger
    Member
    Plugin Author

    Posted 7 months ago #

    The code belongs anywhere in your themes functions.php

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic