How to link that "logged in" in "you must be logged in to post a comment" for a post on WordPress to custom login page. So that when the user clicks on that "logged in" gets redirected to the custom login page not to the wp-login.php. Please help.
You could change the whole text by adding first parameter to your
comment_form function. According to the Codex, the code below might help:
$comments_args = array( // change the must log in text and link url 'must_log_in'=> '<p class="must-log-in">' . sprintf( __( 'You must be <a href="%s">logged in</a> to post a comment.' ), YOUR_CUSTOM_LOGIN_PAGE_URL ) . '</p>' ); comment_form($comments_args);
Please change the 'YOUR_CUSTOM_LOGIN_PAGE_URL' accordingly.