Link existing forum topic to new WordPress post

I’ve done some work on making a shortcode for displaying Discourse topics. At this point, it only displays the first post in the topic, it doesn’t display any of the comments. It gives you the option of displaying the full post content, an excerpt, or just the title and some metadata about the topic.

The styles I’m using here are rough, but this gives you an idea of how it could work. Adding a couple of shortcodes like this:

[discourse_topic topic_id=384 excerpt_length=45]

[discourse_topic topic_id=385 excerpt_length=45]

will output this:

The shortcodes can be added anywhere you like within a post.

This isn’t yet available in the version of the plugin that’s in the WordPress repository. If the basic idea seems correct I can add it to the repo in the next few days.

4 Likes