-
AuthorPosts
-
March 16, 2014 at 2:31 pm #23624
Hi dear support!
First let me tell you that I love your theme. X is really amazing!
Could you please tell me how it is possible to disable the comment section on pages?
http://golf-duda.de/impressum/ (Password: simsum666)
http://golf-duda.de/datenschutzerklaerung/
Your help is really apreciated 🙂
Cheers
SaschaMarch 17, 2014 at 10:02 am #23787Hey Sascha,
Thank you for your kind words.
You might find this tutorial helpful.
Or, you can copy the code below in your functions.php file if you want to disable it sitewide.
// Disable support for comments and trackbacks in post types function df_disable_comments_post_types_support() { $post_types = get_post_types(); foreach ($post_types as $post_type) { if(post_type_supports($post_type, 'comments')) { remove_post_type_support($post_type, 'comments'); remove_post_type_support($post_type, 'trackbacks'); } } } add_action('admin_init', 'df_disable_comments_post_types_support'); // Close comments on the front-end function df_disable_comments_status() { return false; } add_filter('comments_open', 'df_disable_comments_status', 20, 2); add_filter('pings_open', 'df_disable_comments_status', 20, 2); // Hide existing comments function df_disable_comments_hide_existing_comments($comments) { $comments = array(); return $comments; } add_filter('comments_array', 'df_disable_comments_hide_existing_comments', 10, 2); // Remove comments page in menu function df_disable_comments_admin_menu() { remove_menu_page('edit-comments.php'); } add_action('admin_menu', 'df_disable_comments_admin_menu'); // Redirect any user trying to access comments page function df_disable_comments_admin_menu_redirect() { global $pagenow; if ($pagenow === 'edit-comments.php') { wp_redirect(admin_url()); exit; } } add_action('admin_init', 'df_disable_comments_admin_menu_redirect'); // Remove comments metabox from dashboard function df_disable_comments_dashboard() { remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); } add_action('admin_init', 'df_disable_comments_dashboard'); // Remove comments links from admin bar function df_disable_comments_admin_bar() { if (is_admin_bar_showing()) { remove_action('admin_bar_menu', 'wp_admin_bar_comments_menu', 60); } } add_action('init', 'df_disable_comments_admin_bar');
Hope that helps. 🙂
March 17, 2014 at 3:09 pm #23892Oh yes thank you very much!
March 18, 2014 at 9:21 am #24125You’re welcome.
September 3, 2014 at 11:37 am #97681Hey support team! I am trying to accomplish the same. I understand what you have told Sasha, I found the function php file, but I do not know where to paste the code above. I don’t want to mess it up. I do want to remove all comment function though.
Thank you!
Lucy
September 3, 2014 at 12:12 pm #97700I watched the tutorial and made the correct changes. Thnx
September 3, 2014 at 1:45 pm #97750Hi Lucy,
You should placed them into functions.php file of your child theme, learn more about child theme here: http://theme.co/x/member/kb/how-to-setup-child-themes/
You can use a plugin instead of any codes if you feel uncomfortable with code changes, the plugin is: http://wordpress.org/plugins/disable-comments/
October 9, 2014 at 4:15 pm #122591Thank you, For the video upload. This knowledge base has been very helpful.
October 10, 2014 at 1:43 am #122794You’re welcome!
November 12, 2014 at 12:56 pm #143583Just wanted to add, when I tried doing this through the wordpress editor I got a 500 Internal Server Error everytime. My workaround was to edit the file locally then upload directly to the child theme folder.
November 12, 2014 at 10:11 pm #143976Thanks for sharing the workaround Kmarois. 🙂
May 28, 2015 at 5:15 pm #285104there really should be a way to disable comments on pages that built into X theme.
May 29, 2015 at 1:56 am #285521Hello There,
We certainly appreciate the feedback! This is something we can add to our list of feature requests. This way it can be taken into consideration for future development. All of these items are discussed with our team internally and prioritized based on the amount of interest a particular feature might receive. Thanks!
June 1, 2015 at 6:14 am #288469This reply has been marked as private.June 1, 2015 at 12:09 pm #288790Hi Henry,
Thank you for writing in! Please enable your wp_debug. To do this open the wp-config.php file on the root directory of WordPress installation, find the:
define('WP_DEBUG', false);
and update it to
define('WP_DEBUG', true);
Let us know the error the site is displaying, also provide us login credentials (Admin and FTP) in private reply so we can take a closer look.
Cheers!
-
AuthorPosts