I’'ve set up my community so that each new post on Wordpress auto-posts to Discourse. The plugin creates a link to the discourse discussion dynamically at the bottom of every wordpress post.
I’m wondering if there’s a way to generate this link on each post in other areas too?
For instance, I want wordpress to also automatically generate a hyperlink on some text near the top of the page that links back to the discourse page for that particular post, but I have no idea how I would go about doing that.
And you will be able to view the discourse available data linked to that wp CPT. Next, you can use a Gutenberg or other plugin to display the discourse link to frontend.
This appears near the top of my articles. Is there a way to provide an atlernative link if the post in question does not have a discourse page (.e.g. older posts before Discourse was installed)
Yes, but it has nothing to do with Discourse, really.
Decide what link you would like to show instead, and then do a quick search on how to use “if” statements in PHP with posts that have empty or missing Wordpress fields.