Skip to main content

Link in comments for users that are not login

Comments

2 comments

  • Permanently deleted user

    Hi Daniel,

    Thank you for contacting us.

    Please try to  add  this functions.php file to the child theme :

    <?php

    // Add to child theme file functions.php
    add_action( 'comment_form_defaults', function( $args ) {
                
        if ( isset( $args['must_log_in'] ) ) {
            $args['must_log_in'] =
                '<p class="brz-must-log-in">' .
                    sprintf(
                        __( 'You must be <a href="%s">logged in</a> to post a comment.', 'brizy' ),
                        get_permalink( $changeToYourPostID )
                    ) .
                '</p>';
        }

        return $args;
        
    }, 11 );

    0
  • Permanently deleted user

    or , you can try to add this file, we don't know exactly which will work , because we did not test it.

     

    <?php

    add_action( 'comment_form_defaults', function( $args ) {
        if ( isset( $args['must_log_in'] ) ) {
            $args['must_log_in'] = str_replace( wp_login_url( apply_filters( 'the_permalink', get_permalink() ) ), get_permalink( $changeToYourPostID ), $args['must_log_in'] );
        }

        return $args;

    }, 11 );

    0

Please sign in to leave a comment.