• Using OceanWP theme anonymous users cannot comment, however they can comment while the site is on another theme. Any solutions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Try to add the below code to the functions.php file and check it works or not –

    function prefix_comment_form_fields( $fields ) {
    
        $req = get_option( 'require_name_email' );
    
        $fields['author'] 	= '<div class="comment-form-author"><input type="text" name="author" id="author" value="'. esc_attr( ['comment_author'] ) .'" placeholder="'. esc_html__( 'Name (required)', 'oceanwp' ) .'" size="22" tabindex="101"'. ( $req ? ' aria-required="true"' : '' ) .' class="input-name" /></div>';
    
        $fields['email'] 	= '<div class="comment-form-email"><input type="text" name="email" id="email" value="'. esc_attr( ['comment_author_email'] ) .'" placeholder="'. esc_html__( 'Email (required)', 'oceanwp' ) .'" size="22" tabindex="102"'. ( $req ? ' aria-required="true"' : '' ) .' class="input-email" /></div>';
    
        $fields['url'] 		= '<div class="comment-form-url"><input type="text" name="url" id="url" value="'. esc_attr( ['comment_author_url'] ) .'" placeholder="'. esc_html__( 'Website', 'oceanwp' ) .'" size="22" tabindex="103" class="input-website" /></div>';
    
        return $fields;
    
    }
    
    add_filter( 'comment_form_default_fields', 'prefix_comment_form_fields' );
    Thread Starter xenoscrewz

    (@xenoscrewz)

    I have tried it, it does not work.

    Try the below code. It should work –

    remove_filter( 'comment_form_default_fields', 'oceanwp_modify_comment_form_fields' );

    • This reply was modified 5 years, 1 month ago by Amit Singh.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘OceanWP prevents Anonymous Commenting’ is closed to new replies.