Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #103064
    Samuel
    Participant

    I recently upgraded from simple catch to simple catch pro. While using simple catch, i successfully managed to remove the website and email field with this function:
    function wpb_disable_comment_url($fields)
    {
    unset($fields[‘url’]);
    return $fields;
    }
    add_filter(‘comment_form_default_fields’,’wpb_disable_comment_url’);
    function wpb_disable_comment_email($fields)
    {
    unset($fields[’email’]);
    return $fields;
    }
    add_filter(‘comment_form_default_fields’,’wpb_disable_comment_email’);
    This no longer works in simple catch pro. I’m kindly requesting help with this issue.

    #103088
    Mahesh
    Participant

    @ugpost: Thank you for using Simple Catch Pro. Please use the following functions instead.

    function wpb_disable_comment_url($fields) {
        if ( isset( $fields['url'] ) ){
            unset( $fields['url'] );
        }
        if ( isset( $fields['fields']['url'] ) ){
            unset( $fields['fields']['url'] );
        }
        return $fields;
    }
    add_filter('comment_form_defaults','wpb_disable_comment_url');
    
    function wpb_disable_comment_email($fields)
    {
        if ( isset( $fields['email'] ) ){
            unset( $fields['email'] );
        }
        if ( isset( $fields['fields']['email'] ) ){
            unset( $fields['fields']['email'] );
        }
        return $fields;
    }
    add_filter('comment_form_defaults','wpb_disable_comment_email');

    Regards,
    Mahesh

    #103090
    Samuel
    Participant

    Excellent! Thank you Mahesh.

    #106172
    Pearl
    Participant

    Hi,

    May I know where to insert the code above? I also wanna remove the website and email field in the comment section. Thanks!

    #106196
    Samuel
    Participant

    Hey Pearl,
    That code would go at the end of your functions.php file of your child theme. If you do not have a child theme, catch themes has a guide on how to create child themes (I do not know the specific url but you can google it). There are a few plugins that could aslo help to make a child theme if the process seems to hard.

    And the last resort (if everything about a child theme seems to0 complicated and you are scared of messing things up) is to add the code to the themes functions.php file BUT just before you do a theme update, go to the functions.php file copy the code, do the update and then open the file again and paste the code afresh since every time you do a theme update the functions.php file will be wiped of any code that you added.

    #106288
    Mahesh
    Participant

    @misstraveling: Thanks @ugpost(Norsam). You can find more details on creating child theme HERE.

    Regards,
    Mahesh

    #107019
    Pearl
    Participant

    Thank you!

    #107080
    Pearl
    Participant

    @Norsam Thanks for your help! For the second method, may I know where can I find the themes functions.php file in WP? Thanks!

    #107088
    Samuel
    Participant

    To find your functions.php file go to your cp panel open file manager go to wp content>>themes>>[select the theme that is currently active]>>functions.php However, when you open the theme that is active, you will see a folder called functions DO NOT change the contents of the folder. Simply scroll down and find the functions.php FILE. That’s what you are looking for, the file and not the folder.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Website field and email field in comments’ is closed to new replies.