I got some funding to do this recent work on it. It will be safe to use by the end of the week. Right now, it’s lacking documentation and the options page needs to be cleaned up. I’m supporting the plugin, so if people use it now and run into any problems, I’ll fix it.
I’m a newb to wordpress and discourse… coming from a good php background with other forum software.
I have WP and Discourse installed and working perfectly with the wp-discourse plugin and discourse acting as SSO.
I can’t get these shortcodes to work for me though. I installed by downloading the zip from git and uploading that zip as a plugin. It took it and it’s activated and the shortcode page shows up within the Discourse section of the WP admin. I’ve tried adding the discourse_topics and discourse_link shortcodes and I get nothing. I’ve tried a few different ways: in a text widget (with my theme modded to allow for short codes), in the shortcode widget itself, and within a normal post.
I’ve tested a couple other shortcodes to make sure shortcodes in general are working.
Anything I’m missing in the setup?
Really want to get some of the discourse embedded in wordpress and it looks like your shortcodes are the best option currently.
Many Thanks,
Mac
Is your forum private? If so, you need to check the Enable Private Topics checkbox on the Shortcodes options page.
If you’re still getting no output, try disabling the Webhook setting if you have it enabled, and using this as the shortcode: [discourse_topics cache_duration=0] It should give you some output. If not, please let me know.
YES. That was it. I had locked things down a bit as I’m converting to Discourse from my old forum software.
Awesome stuff. Thanks so much for the quick reply.
Are you planning to add an option to filter discourse_topics by categories and tags?
We love this plugin! Thank you very much for the work put in it. We use it very prominently at the https://confederac.io homepage.
I second @anon36484860, it would be useful to display items of a single category. For instance:
[discourse_topics source="top" category=" period="weekly" max_topics="5"]
On a different, there seems to be a minor bug. A category is not displayed in the widget:
The category is “Anti-Represión” and is in fact a subcategory. The tilde seems to be fine, because the category “Colaboración” is rendered without problems. Maybe it’s the dash?
Have you recently added the category? If so, go to the Publishing options tab, select the Force Category Update checkbox and save the page. If that doesn’t solve the issue, I’ll take a look at what’s going on.
Yes, adding a Category option is a good idea.
Doh. OK, problem fixed. Thank you. ![]()
Is this plugin still maintained?
I would love to see the ability to make a list of topics by entering individual topic IDs
We are still very interested in this feature. Would it be complex to implement? Would the paid model be an option here?
Hello, Simon.
How to add a script to these ednpoints that will change them e.g. on the basis of api ?
For example:
On my wordspress blog:
Latest Topic discussion (imported from duscourse):
Topic 1 // My City is beauty
Topic 2 // How my Paris looks like
Topic 3 // My trip in New York
And i want to make it like this:
Topic 1 // My City is beauty – null (no city)
Topic 2 // How my Paris looks like + (weather from api for Paris)
Topic 3 // My trip in New York + (weather from api for New York)
etc
Quel est l’état de ce plugin ?
Je n’arrive pas à faire apparaître l’avatar de l’utilisateur et je ne peux pas contrôler la position de la date. La date est correcte, mais j’aimerais vraiment pouvoir afficher l’avatar.
J’ai utilisé ce code : [discourse_topics source="latest" tile=true excerpt_length="55" date_position=bottom]
Et j’obtiens ce résultat :
Qu’est-ce que je fais de mal ?
@simon, tu es là…? ![]()
Peux-tu vérifier la valeur de l’attribut src de l’avatar ? Tu peux le trouver avec l’inspecteur web de ton navigateur. Cela nous donnera une idée du problème.
<img class="wpds-latest-avatar" src="">
Donc pas de triche…
Je ne pourrai pas tester cela avant lundi. Je me mettrai un rappel pour m’en occuper à ce moment-là. En jetant un coup d’œil rapide au code, l’attribut src de l’avatar devrait être défini pour vous. Cependant, je ne vois nulle part dans le code de gestion de l’argument date_position=bottom. Est-ce que supprimer date_position des arguments du shortcode fait une différence ?
Il est possible que la plupart des utilisations de ce plugin puissent désormais être gérées via Embedding a list of Discourse Topics in another site.
Cool, j’ai essayé de le corriger moi-même, mais je n’ai pas réussi…
Pour le moment…
…est bien trop basique.
Pouvez-vous m’envoyer un lien vers le post sur lequel vous utilisez le shortcode ? Je vais examiner ce qui se passe avec l’URL de l’avatar.
J’ai examiné le site à partir duquel vous récupérez les sujets. Le problème vient du fait que, pour obtenir le modèle de l’avatar de l’auteur original, le plugin parcourt les auteurs de chaque sujet afin de trouver celui dont la description est « Original Poster ». Comme votre site est en danois, la description à rechercher pour identifier l’auteur original devrait être « Oprindelig forfatter ».
Je ne suis pas certain qu’il existe une meilleure méthode pour identifier l’auteur original à partir de la liste des sujets. Si vous souhaitez tenter de résoudre ce problème sur votre site, le code à modifier se trouve ici : wp-discourse-shortcodes/lib/discourse-topic-formatter.php at master · communiteq/wp-discourse-shortcodes · GitHub. Remplacer le motif '/Original Poster/' par '/Oprindelig forfatter/' devrait régler le problème.
Je ne pense pas que je vais corriger le problème lié à date_position=bottom. Je vais supprimer ce paramètre du fichier README du plugin. J’aime beaucoup ce plugin, mais à ma connaissance, les shortcodes ne sont plus la meilleure approche pour ce type de fonctionnalité sur WordPress. Un nouveau plugin permettant d’ajouter un Bloc de liste de sujets Discourse à une publication WordPress serait idéal.
Ça a résolu le problème ![]()
Merci !

