First, I want to say a big, heartfelt thank you to @angus for sticking with me through this and providing such thoughtful guidance. Your support means a lot, and I genuinely appreciate the time and effort you’ve put into helping me troubleshoot this. Let me walk you through everything I’ve explored and tried, hoping it might help others facing similar issues.
Background and Initial Setup:
Initially, we were using the Extol theme, where we added the Discourse comment block directly in the single post page itself. This worked perfectly fine. When we switched to the Astra theme, things became more complicated. Since Astra has some limitations (like not being able to easily edit the default single post template), I added the Discourse comment box via Astra Site Builder hooks and placed it under the post based on a display condition.
This worked smoothly for most posts, but for three specific posts, the Discourse comment section appeared twice. I couldn’t figure out why this was happening only for these posts, while others displayed correctly. This anomaly led me to think there might be a remnant of the old Extol setup, but I couldn’t pinpoint anything definitive.
Exploring the Issue:
- I first checked the post editor, looking for any settings or blocks that might have been manually enabled or disabled for Discourse comments. Surprisingly, there was nothing there—no extra blocks, no different settings.
- Next, I disabled the Astra Site Builder hook to see if that would remove the extra comment section. It didn’t; the duplicate box remained. This suggested the duplication was happening outside the Astra Site Builder setup.
- I then tried disabling “Enable Discourse Comments” in the WP Discourse settings. As you advised, this removed both comment sections, which indicated that both were being generated through this integration somehow.
- After re-enabling it, I dug deeper into the theme files. I searched through single.php, content-single.php, and other related template files for any instance of
comments_template();
. Unfortunately, I couldn’t find anything explicitly calling this function. This left me puzzled. If it was a PHP template issue, why couldn’t I find it?
- I also tried checking for custom templates. Maybe these three posts were using a different template? I couldn’t confirm this either. Everything pointed to the default setup.
- Another theory was related to comment synchronization—maybe when someone commented on the Discourse forum, it triggered another comment section to appear under the related blog post. This seemed plausible, but I couldn’t find a setting or documentation that directly linked to this behavior.
- I resorted to a temporary CSS fix to hide the duplicate comment section:
Added CSS on WP Theme Customizer Additional CSS
#comments {
display: none !important;
}
Added CSS on Astra hook:
#comments {
display: block !important;
}
While this worked, I agree it’s not a permanent solution. I’d much prefer to address the root cause.
Thoughts and Theories:
- I suspect it could be a deeper issue with how Astra handles hooks and blocks—perhaps some conflict or duplication in the way the Discourse comments are embedded.
- Another possibility is that there’s a hidden setting or leftover configuration from the old Extol theme that’s still influencing things.
- Or it might be related to how Discourse synchronizes with WordPress. When a comment is made in the forum, it might be triggering something within the WordPress site, creating that extra section.
What I Haven’t Tried:
- Contacting Astra Support: As you suggested, this might be worth pursuing. They might be aware of similar issues or can provide insights into how their theme handles comments and hooks.
- Disabling all plugins except WP Discourse: This might help isolate if another plugin is causing this behavior.
- Testing with a completely fresh post: Creating a new post from scratch and seeing if the issue replicates might reveal something.
Next Steps:
For now, I think I’ll explore contacting Astra support and possibly running more tests with plugins disabled. I might also try a different approach by using a child theme and seeing if I can manually handle the Discourse comments section more precisely.
Again, Angus, thank you so much for your help and patience. Your insights have been invaluable, and even though I haven’t cracked it yet, I feel closer to understanding what’s happening. If anyone else has thoughts, insights, or experiences with similar issues, I’d love to hear them!
I’ll keep digging and will update here if I discover anything new. Cheers!