There are several ways to override the default comments view of the Customizr WordPress theme.
1) Overriding the comments.php template with a child theme.
You can make a copy of the comments.php file of the theme, paste it into your child theme and add custom code there. The Child theme template will override the initial file.
2) Working with hooks : recommended
add_action('wp_head', 'my_comments_actions'); function my_comments_actions(){ /* do nothing if the class isn't referenceable, e.g. api changed */ if ( ! class_exists('TC_comments') ) return; /* Your custom actions below */ remove_action ( '__after_loop', array( TC_comments::$instance , 'tc_comments' ), 10 ); add_action( '__after_loop', 'my_comment_callback'); }
- Remove the action calling the template in class-content-commments.php and replace it by another action (code above)
- Hook in the built-in comment_form() function with the ‘comment_form’ action hook
- Use the comments hooks of the theme listed in the hooks API reference of the Customizr : tc_comment_title, tc_comment_list, tc_comment_navigation, tc_comment_close, tc_set_comment_title
10 thoughts on “Customizing the comments in the Customizr theme”
Hi, comment section is not showing up at all in my blog section and never did.. Wanted it under blog posts. Have googled and read all what is written about it but nothing helps. Have newest wp and customzr versions, have checked plugin compatibility, enabled comments on posts and pages(well, want comments only on posts) in theme, in settings discussion but no changes. Any suggestions, please?!
Hi Irisa,
Please open a new thread in the support forum about this : https://wordpress.org/support/theme/customizr
We’ll try to help 🙂
Cheers
I am trying to un-hook ‘tc_comment_title’ from the hook ‘__comment’ and it’s not working. (I want to replace it with my own hook.)
I am not familiar with PHP classes, but the example you provide above doesn’t work for me.
Can you point me in the right direction?
Thanks!
(I apologize if I submitted this question twice. I thought I hit “post comment”, but I don’t see that my question was saved.)
Hello Jean,
don’t worry, it happens 😉
Thanks for reporting this, snippet updated 😉
Your code doesn’t work anymore because of some changes in the api.
The following code should work (n.b. your code’s aim is to unhook “One(N) thought(s) on ..” , right? That’s what that action hook does.)
Hope this helps.
Thanks, Rocco!
Yes, it’s the “X thoughts on …” text that I want to change. I have a page where the I’m changing the “Comments” into “Thank you notes”, and want to change “X thoughts on….” to “X people have posted a thank-you note.”
I see, hope you will find a way, or maybe you already have it 😉
I’m having a hard time removing an action hook from the comments class. Your example above
doesn’t seem to work for me. I just get a blank screen when loading the page in the browser.
I’m not familiar enough with PHP classes, but I’ve tried the code above, and I’ve looked at different ways of removing hooks that come from classes, and they don’t seem to work for me. Can you steer me in the right direction?
I’m trying to create my own tc_comment_title function, so I want to remove the hook from __comments.
Hello,
Could you tell what hook need to use for embedding of some code or text to inside of each comment, for example before or after comment content? Unfortunately, I have not found this information. In my case I want to place social code to each comment.
Regards,
Arni
hola!
Es posible personalizar la tipografía del titulo de los comentarios así como los iconos , el color del marco etc
tengo la versión 3.2.8
gracias!
hello!
You can customize the typography of the title of comments and icons, the frame color etc
have version 3.2.8
thanks
Hola,
If you are not a developer, you can personalize any typography you want in live preview with the WordPress Font Customizer fully compatible with the Customizr theme.
Cheers