# Wp-discourse-shortcodes plugin

**URL:** https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910
**Category:** Extras
**Created:** [8월 20, 2016, 1:41오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910 "2016-08-20T01:41:38Z")
**Posts on this page:** 20
**Page:** 3

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [9월 11, 2017, 4:50오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/42 "2017-09-11T16:50:19Z")

</div>

> [@erlend\_sh](#):
>
> Is the plugin safe for production use now?

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.

---

<div class="post-metadata">

### Author: ![ninermac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ninermac/32/135729_2.png) [@ninermac](https://meta.discourse.org/u/ninermac)
#### Post date: [1월 7, 2018, 1:47오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/43 "2018-01-07T01:47:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [1월 7, 2018, 2:15오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/44 "2018-01-07T02:15:40Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![ninermac](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ninermac/32/135729_2.png) [@ninermac](https://meta.discourse.org/u/ninermac)
#### Post date: [1월 7, 2018, 5:00오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/45 "2018-01-07T17:00:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![anon36484860](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@anon36484860](https://meta.discourse.org/u/anon36484860)
#### Post date: [3월 13, 2018, 4:42오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/46 "2018-03-13T16:42:45Z")

</div>

Are you planning to add an option to filter discourse\_topics by categories and tags?

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [10월 1, 2018, 9:29오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/47 "2018-10-01T21:29:04Z")

</div>

We love this plugin! Thank you very much for the work put in it. We use it very prominently at the [https://confederac.io](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:

 ![Screenshot%20from%202018-10-01%2023-23-33](https://global.discourse-cdn.com/meta/original/3X/7/e/7e0327cf403cf908464e3004da78bc3f364dceca.png)

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?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [10월 1, 2018, 9:35오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/48 "2018-10-01T21:35:17Z")

</div>

> [@icaria36](#):
>
> On a different, there seems to be a minor bug. A category is not displayed in the widget:

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.

> [@icaria36](#):
>
> it would be useful to display items of a single category

Yes, adding a Category option is a good idea.

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [10월 2, 2018, 7:09오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/49 "2018-10-02T07:09:03Z")

</div>

> [@simon](#):
>
> Have you recently added the category?

Doh. OK, problem fixed. Thank you. 😊

---

<div class="post-metadata">

### Author: ![jrgong](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jrgong](https://meta.discourse.org/u/jrgong)
#### Post date: [4월 17, 2019, 2:16오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/50 "2019-04-17T02:16:10Z")

</div>

Is this plugin still maintained?

I would love to see the ability to make a list of topics by entering individual topic IDs

---

<div class="post-metadata">

### Author: ![icaria36](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/icaria36/32/426431_2.png) [@icaria36](https://meta.discourse.org/u/icaria36)
#### Post date: [5월 17, 2019, 12:16오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/51 "2019-05-17T12:16:31Z")

</div>

> [@simon](#):
>
> Yes, adding a Category option is a good idea.

We are still very interested in this feature. Would it be complex to implement? Would the paid model be an option here?

---

<div class="post-metadata">

### Author: ![eextra](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eextra/32/170266_2.png) [@eextra](https://meta.discourse.org/u/eextra)
#### Post date: [5월 23, 2019, 5:22오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/52 "2019-05-23T05:22:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [8월 19, 2019, 10:21오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/53 "2019-08-19T10:21:27Z")

</div>

What is the status of this plugin?

Im not able to get the user avatar to show up and Im not able to control date\_position. The last is okay, but I would really like to be able to show the avatar

I did use this code: `[discourse_topics source="latest" tile=true excerpt_length="55" date_position=bottom]`

And I get this output

 ![22](https://global.discourse-cdn.com/meta/original/3X/3/3/331e6ffaab444232e077dbd0c746cc7a93abcd25.png)

What Im doing wrong?

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [8월 23, 2019, 6:49오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/54 "2019-08-23T06:49:18Z")

</div>

@simon are you out there…? 😃

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8월 23, 2019, 3:47오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/55 "2019-08-23T15:47:42Z")

</div>

> [@frold](#):
>
> Im not able to get the user avatar to show up

Can you look at what the value of the `src` element is for the avatar? You can find this with your browser’s web inspector. That will give us an idea of what the problem is.

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [8월 23, 2019, 4:07오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/56 "2019-08-23T16:07:58Z")

</div>

`<img class="wpds-latest-avatar" src="">`

So no scr…

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8월 23, 2019, 4:38오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/57 "2019-08-23T16:38:03Z")

</div>

I’m not going to be able to test this before Monday. I’ll set myself a reminder to look at it then. From quickly looking over the code, the avatar `src` should be getting set for you. I don’t see anywhere in the code that is handling the `date_position=bottom` argument though. Does removing `date_position` from the shortcode arguments make any difference?

Possibly most uses of this plugin will now be able to be handled by [Embedding a list of Discourse Topics in another site](https://meta.discourse.org/t/embedding-a-list-of-discourse-topics-in-another-site/125911).

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [8월 26, 2019, 6:20오전 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/58 "2019-08-26T06:20:27Z")

</div>

> [@simon](#):
>
> I’m not going to be able to test this before Monday

Cool, I did try to fix it my own - but I wasnt able to do it…

At the moment …

> [@simon](#):
>
> Possibly most uses of this plugin will now be able to be handled by [Embedding a list of Discourse Topics in another site](https://meta.discourse.org/t/embedding-a-list-of-discourse-topics-in-another-site/125911).

…is far to basic.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8월 26, 2019, 11:40오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/59 "2019-08-26T23:40:15Z")

</div>

Can you message me a link to a post you are using the shortcode on? I’ll take a look at what is going on with the avatar URL.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [8월 27, 2019, 5:51오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/60 "2019-08-27T17:51:21Z")

</div>

> [@frold](#):
>
> Im not able to get the user avatar to show up

I looked at the site you are pulling the topics from. The problem is that to get the Original Poster’s avatar template, the plugin loops through each topic’s posters to find the poster with the description ‘Original Poster’. Since your site is in Danish, the description that should be searched for to find the Original Poster should be ‘Oprindelig forfatter’.

I’m not sure what would be a better way of finding the Original Poster from the topic list. If you would like to try to fix the issue on your site, the code that needs to be changed is here: [wp-discourse-shortcodes/lib/discourse-topic-formatter.php at master · communiteq/wp-discourse-shortcodes · GitHub](https://github.com/scossar/wp-discourse-shortcodes/blob/master/lib/discourse-topic-formatter.php#L107). Replacing the pattern `'/Original Poster/'` with `'/Oprindelig forfatter/'` should fix the issue for you.

I don’t think I’m going to fix the issue with `date_position=bottom`. I will remove that parameter from the plugin’s README. I like this plugin a lot, but it’s my understanding that shortcodes are no longer the best approach to doing this kind of thing on WordPress. A new plugin that allowed you to add a Discourse Topic List _Block_ to a WordPress post would be great.

---

<div class="post-metadata">

### Author: ![frold](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frold/32/82547_2.png) [@frold](https://meta.discourse.org/u/frold)
#### Post date: [8월 27, 2019, 8:03오후 UTC](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910/61 "2019-08-27T20:03:05Z")

</div>

It solved it 😃

Thanks!

[Previous page](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910.md?page=2)

[Next page](https://meta.discourse.org/t/wp-discourse-shortcodes-plugin/48910.md?page=4)
