Knop toevoegen met link bericht forum

AI-generated summary

In a WordPress forum discussion titled ‘Add button with link post forum,’ McFlyPartages seeks to create a reusable button that automatically links to the corresponding Discourse topic for each WordPress post, avoiding manual URL entry. They note that while Discourse auto-generates topics from WordPress posts, changing titles or URLs breaks links. They also observe that comment sections already display auto-generated links but want to convert them into buttons. Jonathan5 suggests using the Discourse embedding script with dynamic variables like <%= current_page.url %>, which auto-generates topics per page. McFlyPartages confirms the auto-link exists in comments but wants it as a button. Jonathan5 clarifies that the variable approach is likely the solution, and later shares a resource on retrieving the current URL via WordPress shortcodes here Jonathan5. McFlyPartages thanks them and plans to review the resource. The discussion centers on leveraging WordPress variables or shortcodes to dynamically generate Discourse topic links without manual intervention, ideally via a global button block in DIVI theme.

update 2.

Hello,

First of all thank you for this plugin which, once followed by the subject on the configuration, is a real wonder.

I’m trying to create a button with, as URL, the links to the associated forum topic.

It would be in the form of a “global block” or “same button for all post” which I would like not to have to put the url every time.

Two tracks can be useful I think:

  1. Topics automatically created by WordPress to Discourse are in the form `` https: // discourse.url / post-title```

Problem:

  • I first created the articles on the forum then once mature I published it on the site.
  • If I change a title or the links it won’t work or no longer.
  1. Get the variable (if there is one) and either create a shortcode (I don’t know how to do) or maybe via the WordPress variables and create a special URL.

Note: I use DIVI as a Theme builder for my WordPress

Thanks in advance and sorry for my poor English.

Thank you

[HACF] (https://hacf.fr) French Community of Home Assistant

Is this it? Embed Discourse comments on another website via Javascript

I just looked at the topic, I can’t find a way to add a unique link that automatically leads to the forum link.

I think this information should be stored somewhere and usable as a variable?

Thank you for your quick response anyway.

I think the embedding process creates an unlisted topic for each external page it’s used on, which gets listed whenever a reply is posted. Otherwise I don’t think there would be a way of automatically knowing which forum post to link to.

I couldn’t get it to work myself but I think that was a problem with my site rather than Discourse.

In fact this function exists because it automatically appears in the comments.

Oh so you’d like to change the text link to a button?

I would like that when I click on the button it sends me directly to the post.

But I would like a button containing the automatic URL so as not to have to copy paste the address each time.

I do not know if I am clear

You are probably being clear enough for someone who knows more about it :slight_smile: For me, you’d have to describe the steps you’ve taken, what happens and what you want to happen. But do you think this may be your answer?

There is a part that matches, but this leads to important modifications while I think there is a much simpler solution with variables

I will edit my first post to explain in more detail.

Thanks for precious help

De rien. Maybe it’s as well to add the information here or I’ll look more of an idiot for missing the point :slight_smile: In the quoted post above, <%= current_page.url %> is a variable, and I imagine there will be an equivalent for your website.

Thanks again for your help.

I think there is a possibility via the variables in a simple way but I do not think I use the right search terms with my English very French lol

First post updated

Maybe this: Worpdress Shortcode of Current URL | Prodjex

Thank you I’ll look at this as soon as I have a little time