# Einbettung: Diskussion erscheint bei neuen Beiträgen nicht

**URL:** https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818
**Category:** Support
**Created:** [12. Januar 2018 um 09:12 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818 "2018-01-12T09:12:11Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Jane\_Jojo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jane_jojo/32/119485_2.png) [@Jane\_Jojo](https://meta.discourse.org/u/Jane_Jojo)
#### Post date: [12. Januar 2018 um 09:12 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/1 "2018-01-12T09:12:11Z")

</div>

I have incorporated Discourse into my blog via

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963?source_topic_id=74803):
>
> Discourse has the ability to embed the comments from a topic in a remote site using a Javascript API that creates an IFRAME. For an example of this in action, check out [Coding Horror’s blog](http://blog.codinghorror.com/welcome-to-the-internet-of-compromised-things/#discourse-comments). The blog is run via [Ghost](https://ghost.org/) but the comments are embedded from his [Discourse forum](http://discourse.codinghorror.com/t/welcome-to-the-internet-of-compromised-things/3550). One important thing to note with this setup is that users have to navigate to your forum to post replies. This is intentional, as we feel that the posting interface on a Discourse forum is currently much richer than what we …

This is the code I used

```javascript
<div id='discourse-comments'></div>
<script type="text/rocketscript">
DiscourseEmbed = { discourseUrl: 'https://comments.alittlebitofspice.com/',
topicId: };
if(!DiscourseEmbed.topicId)
DiscourseEmbed.discourseEmbedUrl = 'https://www.alittlebitofspice.com/cauliflower-rice-stir-fry-with-eggs-paleo-keto-gluten-free-recipe';
(function() {
var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
})();
</script>

```

Everything works except when topid is empty (for a new post).  
How do I instruct discourse to create a new topic?

```javascript
if(!DiscourseEmbed.topicId)
DiscourseEmbed.discourseEmbedUrl = 'https://www.alittlebitofspice.com/cauliflower-rice-stir-fry-with-eggs-paleo-keto-gluten-free-recipe';

```

Does not seem to work  
Here’s my blog post

> **[Cauliflower Rice Stir Fry with Eggs (Paleo, Keto, Gluten Free)](https://alittlebitofspice.com/cauliflower-rice-stir-fry-with-eggs-paleo-keto-gluten-free-recipe)**
>
> Try this Cauliflower Rice Stir Fry recipe with eggs, veggies, and low-carb goodness. Perfect for Paleo, Keto, and Gluten-Free diets!

and my embedding setup

 ![image](https://global.discourse-cdn.com/meta/original/3X/5/5/559dbddbf6dbaa64d9ff4a5455b190f0664d4a5c.png)

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [12. Januar 2018 um 09:21 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/2 "2018-01-12T09:21:59Z")

</div>

You may be able to create a Topic on Your discourse using the WP-Discourse Plugin.  
are You using it?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [12. Januar 2018 um 09:51 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/3 "2018-01-12T09:51:40Z")

</div>

Since you are using WordPress, I’d also recommend you look into the [wp-discourse](https://github.com/discourse/wp-discourse) plugin. It should make your life a lot easier.

* * *

A few notes to your usage of the embedding feature:

- You only need to use `topicId` when you want to point to an existing topic that wasn’t created by embedding.
- Otherwise it should be fine to always use the `discourseEmbedUrl` with the URL of the blog post.

---

<div class="post-metadata">

### Author: ![Jane\_Jojo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jane_jojo/32/119485_2.png) [@Jane\_Jojo](https://meta.discourse.org/u/Jane_Jojo)
#### Post date: [12. Januar 2018 um 13:54 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/4 "2018-01-12T13:54:14Z")

</div>

Thanks. WP-Discourse had too many issues.  
So I can change the code to

```
DiscourseEmbed = { discourseUrl: 'http://discourse.example.com/',
                     discourseEmbedUrl: 'http://example.com/blog/entry-123.html' };

```

and it should work, right?

---

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [12. Januar 2018 um 14:38 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/5 "2018-01-12T14:38:03Z")

</div>

Yeah, that should work.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8. Juni 2024 um 12:43 UTC](https://meta.discourse.org/t/embedding-discussion-not-showing-up-for-new-posts/77818/6 "2024-06-08T12:43:38Z")

</div>

Dieses Thema wurde nach 2339 Tagen automatisch geschlossen. Neue Antworten sind nicht mehr möglich.
