The code works. Other customers have made the modifications and told us it works. I’ve done it myself so I know it works. I tested it before I posted it, and I just tested it again. The code works.
Perhaps you have not made all the necessary modifications? I’ll go through it again, specifically for destination posts, which is what you asked about in another topic.
First, add this code to your ‘functions.php’ file…
// Enable support for comments
function add_destination_comment_support() {
add_post_type_support( 'destination', 'comments' ); // destination
}
add_action('init', 'add_destination_comment_support');
Save and upload.
Next, in the ‘single-destination.php’ template look for this…
<div class="intro">
<p class="lead"><?php echo get_destination_intro(); ?></p>
<div class="entry-content"><?php the_content(); ?></div>
</div>
And change it to this…
<div class="intro">
<p class="lead"><?php echo get_destination_intro(); ?></p>
<div class="entry-content"><?php the_content(); ?></div>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) {
comments_template();
}
?>
</div>
Save and upload.
Now go to Settings > Discussion and make sure the the Allow people to post comments on new articles option is enabled…
That automatically adds a Discussion metabox to the article editor for all NEW posts that support comments, and comments will be enabled by default.
For existing destination posts that you want to enable comments on, edit the article, open the Screen Options tab and enable the Discussion option under the Boxes heading. Then scroll down the page until you see the Discussion metabox and enable the Allow comments option…
Don’t forget to click the Update button to save the changes to the article.
Unfortunately we can’t make these modifications for you so if you are unable to make them work yourself you will need to consider hiring a professional to help you.
Thanks.