WP Discourse on Theme Lacking Site Editor

AI-generated summary

In a WordPress discussion titled “WP Discourse on Theme Lacking Site Editor,” cogdog reports that after a recent plugin update, Discourse comments stopped appearing on their podcast site using the Anders Noren Garfunkel theme. The theme lacks Full Site Editor (FSE) support, and comments are rendered via a hardcoded template tab, not widgets. To work around this, cogdog manually injects Discourse discussions using JavaScript via a child theme, disabling WordPress comments entirely. angus suggests using the WP Discourse Comment Block, which works on FSE themes. cogdog confirms using the block successfully on another FSE site but seeks a way to insert it via PHP in a classic theme, asking if it’s possible to integrate the block into the existing template without switching themes. angus seeks clarification on whether the issue is caused by the plugin update, theme incompatibility, or other factors — suggesting a step-by-step troubleshooting approach. The thread highlights the challenge of integrating modern block-based features into legacy WordPress themes without FSE support.

I’ve been happy using the WP Discourse plugin for our podcast WordPress site to connect to our Discourse Community. I stopped seeing the Discourse discussions sometime ago after the latest plugin update.

I might be wrong but it looks like now the way to add it to a template is via Full site Editor (?). I might look to change but am very happy with my Anders Noren Garfunkle theme. It’s single post template has a layout that puts comments in a tabbed display at the bottom of the post, outside the range of widgets.

I did consider just manually adding a Discourse block to all posts, but for now have made an adjustment that inserts the Discourse discussions using the HTML code. In my child theme, I comment out the standard WordPress comments template (we only allow comments via Discord), and check the post meta data for a discourse ID.

<?php //comments_template( '', true ); ?>

<?php
	$discourse_topic_id = get_post_meta( $post->ID, 'discourse_topic_id', 1 ); ?>
	
	<?php if ($discourse_topic_id) : ?>
	
		<div id="discourse-comments"></div>

			<script type="text/javascript">
			  DiscourseEmbed = { discourseUrl: 'https://connect.oeglobal.org/',
								 topicId: '<?php echo $discourse_topic_id?>' };
			
			  (function() {
				var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
				d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
				(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
			  })();
			</script>
	
<?php endif; ?>

It’s not as fancy a layout but works for now – see bottom of newest episode for example.

Hey @cogdog glad to hear how you’re using the plugin. You mentioned using blocks. Have you tried the WP Discourse Comment block?

Yes, I use the WP Discourse Comment Block on another site where we have a FSE theme so it is in the template.

My issue is that my blog’s Garfunkel theme does not support it, and the comments space is built into the template. I am not full on with a block theme development- can I insert a block via PHP in the template? I am looking at things like Testing and Feedback for using block based template parts in classic themes – Make WordPress Themes but am not quite sure how to integrate an existing block.

The only other way I could see is adding the WP Discourse Comment Block at the bottom of every post, but I have 88 posts in the site already.

Ok, just rewinding a bit, let’s look at your issue again.

Do you mean you mean that:

  1. You just updated the WP Discourse plugin (and no anything else, i.e. not Wordpress, your theme or other plugins).
  2. Comment sync stopped working

Is that what happened?