Embed a single post / reply in the body of a WordPress post?

Hey @martym,

The easiest way of selecting specific posts for Wordpress comments out of the box is using this commenting option:

Only Import Moderator-Liked

However, I suspect you’re after something more targeted, given you’ve mentioned a “single” post and also that you want to embed it in the body of the post itself. It’s not possible to retrieve a single post, based off of the post number (e.g. this post has a post number of 2) using the WP Discourse Comments functionality, or embed it within the post body for that matter.

To achieve that, you’ll need to write a custom wordpress script (probably in a seperate wordpress plugin) that creates a shortcode to pull a specific post from your Discourse instance and render it. The shortcode would take a post number as an argument. You’d then use that shortcode in the body of your post.

It wouldn’t be too hard, given you can use the existing authentication details used by the WP Discourse plugin in the shortcode’s request to your discourse instance, but it would take some coding.

3 Likes