Discourse categorie link toevoegen aan WordPress

What you are suggesting may work, but I would not recommend anyone edit plugins in this way unless they are fully aware of what they are doing. Otherwise you could easily break your WordPress site. A PR to add a discourse_categories shortcode to the WP Discourse shortcodes plugin is something that might be accepted though.