I did a quick and dirty wordpress plugin so you can easily embed topic content in your wordpress pages using a shortcode. It is still beta AND I’m not a webdevelopper so be careful using it for the moment.
To use it, you just need to provide the url of your discourse forum in the plugin settings and then add this shortcode [discourse topic_id='xxx'] in the editor.
It will include the first post of the topic as pure html in the wordpress page. I did it so our community can create and maintain their project presentation on the forum while it is nicely displayed in the main web site.
This works very well. It would be nice to have an option on the Discourse side for including/excluding posts in a topic. This could be useful for writing documentation.
This is a very useful plugin and very easy to get going.
Displaying /uploads (images and linked files) is broken on my test install. The WP site has https and the Discourse is http, and the URLs are getting rewritten somewhere. I suspect this is no direct fault of the plugin (between Cloudflare and W3 Total cache I have some suspected culprits).
First, I would love to see something like this pulled into the official WP-Discourse plugin. Some of what follows (API integration, etc.) is already part of its functionality.
I’m not a developer either, and wish I could help more. The following are some thoughts on it so far. Not trying to be critical, just thinking out loud and relaying experiences.
###Notes
It would be extra interesting if this got a Discourse API key so WP could access private/group forums. I was thinking it would be cool to have pages a certain set of users could edit via wiki, and that would automatically populate the main site. There may be cases where discussion would be better restricted to logged-in or group users.
Button 1 in the image has no http/https protocol on the link. Not sure if that’s from my WP settings or the plugin.
Not sure where the theme is picking up button 2. It happens that I can and intend to turn the sharing section off on this page anyway, but it is a curiosity.
Displaying the Discourse title and the WP title can be redundant. The ability to toggle this in the WP post edit window would be helpful. Less elegant, but hiding via CSS should more or less suffice.
Displaying the author (in this example, discourse) might be a candidate for toggling as well. As with the title, CSS is probably an okay workaround.
Another way to do this is to create a wordpress custom-post-type for Discourse topics that takes the Discourse forum base_url and topic_id and uses them to fetch the content for the post. The benefit of this is that it allows the Discourse content to be edited in WordPress, and it allows the content to be cached. The downside is that you have to enable CORS on the forum. Also, the content on wordpress is no longer synced live with the content on the forum. That could be a good or a bad thing, depending on what you are trying to accomplish.
I think this can be simplified quite a bit. There’s no need for a custom post type. By leaving it out, access to forum content could always be available through a meta box.
I’m already reaching the max of my wordpress developper skills. It would be great to have some people to work with on the development so it can become a real solution for prod.
There are now templates and you can choose which one to use using the new shortcode option type="subject/full/reverse-full" (requested by @steve_pd) for example:
One problem I see with the ‘full’ option is that it is only downloading the first 20 (or whatever the forum chunk_size is set at) posts in the topic. If there are more than 20 posts in the topic, should there be a ‘load more posts’ link at the bottom of the page?
Version 0.3 dealt with most of my earlier hangups. Thanks, @Matthieu
The ability to give API credentials to allow the plugin to pull from private forums would be icing on the cake, but I understand that would add significant complexity.
Sorry if this looks like cross-posting, but I think this topic is quite connected - I’d like to put a note here about a new alternative plugin that is also capable of displaying Discourse posts in WordPress: