0

How can I override default theme/WP Core comments.php template with my own in the plugin? I searched for different solutions, but they don't work for me.

Or how to hook to the end of any post (even custom post type) to display my custom comments?

4

The comments_template hook:

add_filter( 'comments_template', function ( $template ) {
    return '/absolute/path/to/your/comments.php';
});
  • Great! It's what I want. I'll mark it as answer asap – Demyd Ganenko Dec 13 '16 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.