Plugin Contributor
Leon
(@leonterry)
Hi Phil,
Thanks for the comments 🙂
You can add comments support for matches by adding the following to your themes functions.php file
function add_match_comments() {
add_post_type_support( 'wpcm_match', 'comments' );
}
add_action( 'init', 'add_match_comments' );
You will then need to add the comment template tags to your match template so that they display on the front end.
The easiest way to do that is to hook into the wpclubmanager_after_single_match filter.
Copy the following to your themes functions.php:
function display_match_comments() {
if ( comments_open() || get_comments_number() ) :
comments_template();
endif;
}
add_action( 'wpclubmanager_after_single_match', 'display_match_comments' );
I haven’t tested, but that should work. Let me know if you have any problems.
Cheers
Hi Leon,
Thanks for your quick reply!
I tried it and it worked perfectly, thank you very much.
Phil
(@philcummings)
9 years, 3 months ago
Hi
I want to start by saying what a fabulous plugin this is, it literally does everyone i need and more!! Big thanks to the developers.
There is just one small thing i’d like to able to do, and that’s to allow commenting on the match reports – as far as i can tell this isnt possible by default so i probably need to put line or two of code somewhere?
I’m not a developer so any help would be very much appreciated.
It would be great if i could use the exisitng WP settings for commenting, eg closing comments after xx days..but this is a nice to have if its too complex.
Thanks in advance for any help