Take your website
To the next level
Discover our newly launched customization services and elevate your web projects to new heights.
Delegate tasks, save time, and unlock the power of professional WordPress outsourcing.

Okay
  Public Ticket #1808466
Remove Discussion on Pages
Closed

Comments

  • rmiller started the conversation

    Hello,

    While I would like to have discussion (aka comments) enabled on Posts, I would like this disabled on Pages. I understand I can disable this on each page, but how can I do this globally as well as disable for any new pages?

  •  7,095
    Oliver replied

    Hi,

    Add this code to the functions.php of the child theme:

    add_action('init', 'remove_comment_support', 100);
    function remove_comment_support() {
    remove_post_type_support( 'page', 'comments' );
    }
    

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • rmiller replied

    Thanks Gregor for the code snippet.

    I added it to my child theme's functions.php, but it doesn't appear to have affected the website as I still see the comment forms.

  •  7,095
    Oliver replied

    pls. provide the wp-admin and FTP access

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •   rmiller replied privately
  •   rmiller replied privately
  •  7,095
    Oliver replied

    Hi,

    I need access to the http authorization.


    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •  7,095
    Oliver replied

      

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • rmiller replied

    My apologies. I forgot to mention the extra layer of security. I have removed the 2nd login. Please try again.

  •  7,095
    Oliver replied

    Hi,

    I was able to login, not I can't connect to your FTP:

    Command: USER [email protected]
    Response: 331 User [email protected] OK. Password required
    Command: PASS ************************
    Response: 530 Login authentication failed
    Error: Critical error: Could not connect to server


    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • rmiller replied

    My apologies.

    I reset the password to what I provided previously and I am now able to connect. Please try again.

    Remember to use plain FTP encryption on port 21

  •  7,095
    Oliver replied

    Hi,

    Still can't connect, ok, another way, you can use this plugin:

    https://wordpress.org/plugins/disable-comments/

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  •   rmiller replied privately
  •  7,095
    Oliver replied

    Another way, in the template:

    /wp-content/themes/thegem/comments.php

    change line:

    if ( post_password_required() ) {

    to:

    if ( post_password_required() or is_page()) {
    

    Before the editing copy this file to the child theme.

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • rmiller replied

    That worked.

    As always, thank you for your time and prompt support!

  •  7,095
    Oliver replied

    Welcome!

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver