Add discourse category link to wordpress

Hello,

Unfortunately from what I can see, there’s no option for that. But you can do it by following these steps:

  1. Install the discourse shortcode plugin and use the schortcode in your text sidebar widget [discourse_topics]

  2. Browse to wp-discourse-shortcodes-master / lib / discourse-topic-formatter.php search for this line
    $category = $this->find_discourse_category( $topic );

  3. After that line, paste this:
    $category_url = $this->discourse_url . "/c/{$category['slug']}/{$category['id']}";

  4. Search for this ( you’ll find two lines, for top and bottom positions ):
    $output .= '<span class="wpds-shortcode-category">' . $this->discourse_category_badge( $category ) . '</span>';

  5. Replace them with:
    $output .= '<span class="wpds-shortcode-category"><a class="wps-cat-link" target="_blank" href="' . esc_url( $category_url ) . '">' . $this->discourse_category_badge( $category ) . '</a></span>';

  6. Go to your wp dashboard and check this box and click Save options
    image

Keep in mind that this will be overwritten when you’ll update the wp-discourse-shortcodes plugin, so you might wanna make a backup before updating. Good luck.