NathanJPearce is experiencing an issue where comments on WordPress pages (e.g., https://www.ff7.com/c2/) aren’t appearing on the page or in Discourse, despite pages showing up as threads in Discourse. The problem stems from the absence of a comments_template in the page’s template. Angus explains that to display comments, the code <?php echo DiscourseUtilities::get_discourse_comments(get_the_ID()); ?> must be added to the template, such as via a code block in the Breakdance editor. After implementing this, Nathan confirms the comments appear on the WordPress page but notes users cannot reply directly on WordPress—only on the Discourse thread. He concludes that users must be directed to the Discourse forum to comment, which aligns with the plugin’s intended functionality NathanJPearce.
Comments I make on the WordPress pages like C20 - Faith Faraday - FF7.com don’t show up on that page itself or in discourse, but there is a thread called C2 in Discourse, with no replies. The corresponding thread to that page is at https://forum.ff7.com/t/c2/11
The reason I’m trying to get this to work on pages is because I put rather short URLs at the end of each chapter of my book, and I really don’t want to redirect people.
I’m using my own install of Discourse, by the way.
Ah, I think the issue in this case is that the page you’re trying to render comments on page that doesn’t have a comments_template. Check out “Display comments without loading the WordPress comments template” in
Thank you so much! Please forgive the newbie question, it’s been nearly 30 years since I was a web developer, but where in my template do I paste that code? I’m using the Breakdance template.
I’m not familiar with the breakdance template. You’ll need to edit the template on the page you linked to. Does breakdance have a code block or code element? If so use that to insert this snippet at the relevant location.
<?php
use WPDiscourse\Utilities\Utilities as DiscourseUtilities;
$discourse_comments = DiscourseUtilities::get_discourse_comments(get_the_ID());
echo $discourse_comments;
?>
I tried putting it in the header, but it ended up rendering on the page, so I’m going to try to put it in the top menu template as a code block. I’ll let you know how it goes!
I missed your point about putting the code block in the correct location. That worked! But the viewer can’t comment/reply here on WordPress. Maybe I’m misunderstanding the feature?
Looking into the documentation/threads further, I now understand that I can only allow people to comment and use the advanced discourse features on the discourse view (makes sense), but I can render n number of comments on the WordPress page. I’m just going to have to have a link at the bottom that instructs them to reply after clicking the “Continue the discussion at forum.ff7.com” link.